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`
18 # Just make the parent directory for $tmp/$repo
19 parentdir=`dirname $tmp/$repo`
20 ret=`mkdir -p $parentdir 2>&1`
25 if [ $code != 0 ]; then
26 error "command failed mkdir -p $parentdir"
29 ret=`trac-admin $src/$repo hotcopy $tmp/$repo 2>&1`
34 if [ $code != 0 ]; then
35 error "command failed -- trac-admin $src/$repo hotcopy $tmp/$repo"
40 if [ $error -eq 1 ]; then
41 echo "Error: because of earlier errors, we are leaving trac backups in $tmp instead of $dest"
43 if [ -d $dest -a -d $tmp ]; then