What is it?
A Perl cron script that creates and rotates backups of one or more Subversion repositories.
What does it do?
- Verifies repositories (svnadmin verify)
- Hot copies -or- dumps repositories (uses svnadmin hotcopy -or- svnadmin dump)
- Archives all repositories to a single tar file
- Gzips tar file
- Backup rotation
- Email notifications
- Nice output
ConfigureAt the top of svnbak.pl is a "Configuration Section" that you must add specific information to in order for the script to work.
- reposDir: full path to your Subversion repository, or the parent directory of all your repositories.
- destDir: full path to the directory where the backups should be saved. To save backups to a network file system, first mount the file system, then specify the mounted path.
- maxBaks: maximum number of backups to retain. Once this limit is reached, the script will automatically remove the oldest backup based on it's last modified time.
- svnBakMethod: type of Subversion backup to create ('hotcopy' or 'dump').
- tarballName: the name of the backup file. Each backup file will be appended with a 14 digit time stamp to preserve singularity.
- tmpDir: full path to a new temporary directory to store files before tarballing. This directory should not be an existing directory - it will be deleted!
- emailPref: when the admin should receive emails ('always', 'errors', 'none').
- displayTime: display execution time in seconds, per task.
- Syntax error fix.
- Repos are now tar'd and gzip'd locally in /tmp, and then transferred to the final destination dir.
- fixed failure of external commands running longer than 60 seconds
- fixed fatal error when backing up a single repository
- destination directory is created if it does not already exist
- changed elapsed time format: 'seconds' -> 's'
- added backup option of dumping repositories via svnadmin dump
- increased error checking
- fixed: some repositories skipped when there was a large number of repositories
- initial release