]> git.openstreetmap.org Git - chef.git/blob - cookbooks/git/templates/default/backup.cron.erb
Use variable to enable readonly mode, as was used in the previous version of the...
[chef.git] / cookbooks / git / templates / default / backup.cron.erb
1 #!/bin/sh
2
3 # DO NOT EDIT - This file is being maintained by Chef
4
5 T=$(mktemp -d -t -p /var/tmp git.XXXXXXXXXX)
6 D=$(date +%Y-%m-%d)
7 B=<%= node[:git][:backup] %>-$D.tar.gz
8
9 ln -s /var/lib/git $T/git-$D
10
11 export GZIP="--rsyncable -9"
12 export RSYNC_RSH="ssh -ax"
13
14 nice tar --create --gzip --dereference --directory=$T --file=$T/$B git-$D
15 nice rsync $T/$B backup::backup
16
17 rm -rf $T