Mar 31
Subversion Backups
I've written a script that can be used to backup a Subversion repository. It should be run from cron, and generates full backups on Sundays, and incremental backups otherwise.
The backups are compressed using bzip2. To restore from backup, create a new repository:
$ svnadmin create /path/to/repository
Next, restore from the most recent full backup, and then from each incremental backup in order:
$ bunzip2 full.bz2 | svnadmin load /path/to/repository $ bunzip2 inc1.bz2 | svnadmin load /path/to/repository $ bunzip2 inc2.bz2 | svnadmin load /path/to/repository
You should backup the /opt/backup directory (where this script places
the Subversion backup files) using a standard back scheme.