For your information, this is my backup script. It produces a zip file
that can be tranported to another computer. The zip file unpacks into a
repository collection, giving, for each repository, a hotcopy of the
repository and a dump of the repository. The hotcopy can be reloaded on
a computer with the same characteristics as the original server; the
dumps can be loaded onto a different computer. Comments are welcome.
# requires root access
if [ ! `whoami` == root ]
# controlling parameters
ls -ld $SRCE
# Construct a new empty SVNParent repository collection
rm -rf $DEST
chown $APACHE_USER $DEST
chgrp $APACHE_GROUP $DEST
chmod 0700 $DEST
ls -ld $DEST
# Get all the names of all the repositories
# (Also gets names of any other entry in the SVNParent directory)
ls -d1 * >/tmp/SVNBackup.tmp
# Process each repository
for REPO in `cat /tmp/SVNBackup.tmp`
# some things are not repositories; ignore them
if [ -d $SRCE/$REPO ]
# back up this repository
echo "Backing up $REPO"
# use hotcopy to get an exact copy
# that can be reloaded onto the same system
svnadmin hotcopy $SRCE/$REPO $DEST/$REPO
# use dump to get an inexact copy
# that can be reloaded anywhere
svnadmin dump $SRCE/$REPO >$DEST/$REPO.dump
# Show the contents
echo "Contents of the backup:"
ls -ld $DEST/*
# zip up the result
zip -r -q -y $DEST.zip .
# Talk to the user
echo "Backup is in file $DEST.zip:"
ls -ld $DEST.zip
# The file $DEST.zip can now be transported to another computer.
Received on 2011-07-26 08:34:18 CEST