]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/git/templates/default/backup.cron.erb
Bring git backup script under chef control
[chef.git] / cookbooks / git / templates / default / backup.cron.erb
diff --git a/cookbooks/git/templates/default/backup.cron.erb b/cookbooks/git/templates/default/backup.cron.erb
new file mode 100644 (file)
index 0000000..16f8559
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+# DO NOT EDIT - This file is being maintained by Chef
+
+T=$(mktemp -d -t -p /var/tmp git.XXXXXXXXXX)
+D=$(date +%Y-%m-%d)
+B=git-$D.tar.gz
+
+ln -s /var/lib/git $T/git-$D
+
+export GZIP="--rsyncable -9"
+
+nice tar --create --gzip --dereference --directory=$T --file=$T/$B git-$D
+nice rsync $T/$B backup::backup
+
+rm -rf $T