1 # -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*-
3 # this handler will backup trac environments (based on the svn handler)
5 # http://trac.edgewall.com/
8 getconf src /var/lib/trac
9 getconf dest /var/backups/trac
10 getconf tmp /var/backups/trac.tmp
14 for repo in `find . -name VERSION`
23 # Just make the parent directory for $tmp/$repo
24 parentdir=`dirname $tmp/$repo`
25 ret=`mkdir -p $parentdir 2>&1`
30 if [ $code != 0 ]; then
31 error "command failed mkdir -p $parentdir"
34 ret=`trac-admin $src/$repo hotcopy $tmp/$repo 2>&1`
39 if [ $code != 0 ]; then
40 error "command failed -- trac-admin $src/$repo hotcopy $tmp/$repo"
45 if [ $error -eq 1 ]; then
46 echo "Error: because of earlier errors, we are leaving trac backups in $tmp instead of $dest"
48 if [ -d $dest -a -d $tmp ]; then