2 # this handler will backup subversion repostitories.
5 getconf src /var/lib/svn
6 getconf dest /var/backups/svn
7 getconf tmp /var/backups/svn.tmp
8 getconf HOTBACKUP /usr/lib/subversion/hot-backup.py
13 # If vservers are configured, decide if the handler should
14 # use them or if it should just operate on the host
15 if [ "$vservers" = "yes" ]
19 info "Using vserver '$vsname'"
22 info "No vserver name specified, actions will be performed on the host"
26 # Check to make sure that the specified vserver exists
29 vroot="$VROOTDIR/$vsname"
30 [ -d $vroot ] || fatal "vserver '$vsname' does not exist at '$vroot'"
34 for repo in `find . -name svnserve.conf`
39 ret=`mkdir -p $vroot$tmp/$repo 2>&1`
44 if [ $code != 0 ]; then
45 error "command failed mkdir -p $vroot$tmp/$repo"
50 ret=`$VSERVER $vsname exec $HOTBACKUP $src/$repo $tmp/$repo 2>&1`
52 ret=`$HOTBACKUP $src/$repo $tmp/$repo 2>&1`
58 if [ $code != 0 ]; then
59 error "command failed -- $HOTBACKUP $vroot$src/$repo $vroot$tmp/$repo"
64 if [ $error -eq 1 ]; then
65 echo "Error: because of earlier errors, we are leaving svn backups in $vroot$tmp instead of $vroot$dest"
67 if [ -d $vroot$dest -a -d $vroot$tmp ]; then
70 if [ -d $vroot$tmp ]; then
71 mv $vroot$tmp $vroot$dest