aboutsummaryrefslogtreecommitdiff
path: root/handlers/trac
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2005-06-13 19:37:26 +0000
committerMicah Anderson <micah@riseup.net>2005-06-13 19:37:26 +0000
commitd52a1ac97e97c51c15ccd52d7dce93d3a092e636 (patch)
tree42918cd2f4a8eca871c90b11f36d0d32149bf856 /handlers/trac
parent5c874587546b032230a74ca09d8ba98548785c9e (diff)
downloadbackupninja-d52a1ac97e97c51c15ccd52d7dce93d3a092e636.tar.gz
backupninja-d52a1ac97e97c51c15ccd52d7dce93d3a092e636.tar.bz2
Added trac handler, changed VSERVERS variable to be lowercase and
added some vserver documentation to README and to the handlers
Diffstat (limited to 'handlers/trac')
-rw-r--r--handlers/trac51
1 files changed, 51 insertions, 0 deletions
diff --git a/handlers/trac b/handlers/trac
new file mode 100644
index 0000000..d344082
--- /dev/null
+++ b/handlers/trac
@@ -0,0 +1,51 @@
+#
+# this handler will backup trac environments (based on the svn handler)
+#
+# http://trac.edgewall.com/
+#
+
+getconf src /var/lib/trac
+getconf dest /var/backups/trac
+getconf tmp /var/backups/trac.tmp
+
+error=0
+cd $src
+for repo in `find . -name VERSION`
+do
+ repo=`dirname $repo`
+
+ # Just make the $tmp dir, not $tmp/$repo
+ ret=`mkdir -p $tmp 2>&1`
+ code=$?
+ if [ "$ret" ]; then
+ debug "$ret"
+ fi
+ if [ $code != 0 ]; then
+ error "command failed mkdir -p $tmp"
+ fi
+
+ ret=`trac-admin $src/$repo hotcopy $tmp/$repo 2>&1`
+ code=$?
+ if [ "$ret" ]; then
+ debug "$ret"
+ fi
+ if [ $code != 0 ]; then
+ error "command failed -- trac-admin $src/$repo hotcopy $tmp/$repo"
+ error=1
+ fi
+done
+
+if [ $error -eq 1 ]; then
+ echo "Error: because of earlier errors, we are leaving trac backups in $tmp instead of $dest"
+else
+ if [ -d $dest -a -d $tmp ]; then
+ rm -rf $dest
+ fi
+ if [ -d $tmp ]; then
+ mv $tmp $dest
+ fi
+fi
+
+exit 0
+
+# vim: filetype=sh