svn backup

From Noah.org
Revision as of 19:34, 12 March 2010 by Root (talk | contribs) (Created page with 'Category: Engineering Category: SVN <pre> #!/bin/sh # This creates a backup of an SVN repository. This should be run # on the repository side. After that completes a sep…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search


#!/bin/sh
# This creates a backup of an SVN repository. This should be run
# on the repository side. After that completes a separate process
# should be run on the remote backup server side. The remote backup 
# server should pull the backup file by running the following command:
#     rsync -avz backup@svn.example.com:/home/svn/svn_backup.tar.gz .

if [ -r svn_backup.tar.gz ] ; then
    mv -f svn_backup.tar.gz svn_backup-previous.tar.gz
fi
svnadmin hotcopy /home/svn/ /home/svn/svn_backup.tar.gz
(cd /home/svn/ && tar -svn_backup.tar svn_backup)
gzip --rsyncable /home/svn/svn_backup.tar
chgrp backup /home/svn/svn_backup.tar.gz
rm -rf /home/svn/svn_backup