wiki:TracHotBackupScript

Version 2 (modified by Kevin Calcagno, 15 years ago) (diff)

--

Backup tool that enhances the trac-admin hotcopy utility

Description

Script that provides some additional tooling around TracAdmin's hotcopy function. The script supports archiving the backup in gzip, bzip2, or zip format and can be configured to retain a specified number of past backups. Ideal for use as a cron job.

The script is derived from the 'hot-backup.py' script included in the Subversion distribution which provides similar tooling around Subversion's hotcopy utility.

USAGE: trac-hot-backup.py [OPTIONS] PROJECT_PATH BACKUP_PATH

Create a backup of the project at PROJECT_PATH in a subdirectory of
the BACKUP_PATH location, named with the backup date and time.

Options:
  --archive-type=FMT Create an archive of the backup. FMT can be one of:
                       bz2 : Creates a bzip2 compressed tar file.
                       gz  : Creates a gzip compressed tar file.
                       zip : Creates a compressed zip file.
  --num-backups=N    Number of prior backups to keep around (0 to keep all).
  --help      -h     Print this help message and exit.

Bugs/Feature Requests

Existing bugs and feature requests for TracHotBackupScript are here.

If you have any issues, create a new ticket.

Download

Download the zipped source from [download:trachotbackupscript here], or just grab the script itself here.

Source

You can check out TracHotBackupScript from here using Subversion, or browse the source with Trac.

Examples

Back up the project at /var/trac/myproj to /nfs/backup/trac/myproj-YYYY-mm-dd-HHMM:

  $ trac-hot-backup.py /var/trac/myproj /nfs/backup/trac

Back up the project at /var/trac/myproj to /nfs/backup/trac/myproj-YYYY-mm-dd-HHMM.tar.gz and delete all but the seven most recent backups (including the one just created):

  $ trac-hot-backup.py --archive-type=gz --num-backups=7 /var/trac/myproj /nfs/backup/trac

Recent Changes

16744 by rjollos on 2017-08-24 01:09:05
Remove hard-code path to trac-admin

Patch by Jun Omae.

16743 by rjollos on 2017-08-23 17:00:42
Fix unable to specify archive type

Patch by Jun Omae.

16742 by rjollos on 2017-08-22 20:26:41
Reformat using autopep8
(more)

Author/Contributors

Author: kcalcagno
Contributors: