trac-admin is Trac's administrative tool. Through trac-admin, an admin may backup individual projects. However, trac-admin does not provide a mechanism to backup the Trac root directory and therefore all projects under this directory. Secondly trac-admin does not provide a mechanism for compression of said backups. In search for an solution to these two issues, I came across trac-backup.
trac-backup backups the entire Trac root directory and compresses the individual project directories through tar and gzip. I modified trac-backup to provide more verbose logging messages, compresses the entire backup of the Trac root directory and only keeps the ten newest backups.
trac-backup-ng relies on the delbut script. delbut deletes all but the newest number of files specified by the first argument supplied to it. John Simpson wrote delbut and as such you will need his GPG key to verify delbut's signature. The download listed below for delbut is valid for the file as of May 20, 2008. Please check John's code page for the latest download block.
# cd /usr/local/bin
# wget -c
http://www.jms1.net/code/delbut
# chmod 755 delbut
# chown root.root delbut
Next, you need to download trac-backup and install it on your server. The below commands will install trac-backup.
# cd /usr/local/bin
# wget -c
http://www.antagonism.org/scripts/trac-backup-ng
# chmod 755 trac-backup-ng
# chown root.root trac-backup-ng
trac-backup-ng takes two arguments. The first argument is the Trac environment's root directory. This is the same directory as set by the "TracEnvParentDir" directive in your httpd.conf file. The second argument is the directory where you want to store the backups. The below example demonstrates trac-backup-ng making a hotcopy of the trac environment root directory, "/var/www/html/trac" and its projects to the backup directory, "/backup".
# trac-backup-ng /var/www/html/trac /backup
By default, trac-backup-ng will keep the last ten backups. You may modify this by editing the script and changing the number proceeding the call to delbut.
|
||||||||||||||
|