]> git.openstreetmap.org Git - chef.git/blob - cookbooks/thinkup/templates/default/backup.cron.erb
Revert "Add v. ugly temp workaround so that daily UCL backups complete"
[chef.git] / cookbooks / thinkup / 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 thinkup.XXXXXXXXXX)
6 D=$(date +%Y-%m-%d)
7 B=thinkup-$D.tar.gz
8
9 mkdir $T/thinkup-$D
10 mysqldump --user=thinkup --password=<%= @passwords["database"] %> --opt thinkup > $T/thinkup-$D/thinkup.sql
11 ln -s /srv/thinkup.openstreetmap.org $T/thinkup-$D/www
12
13 export GZIP="--rsyncable -9"
14
15 nice tar --create --gzip --dereference --directory=$T --file=$T/$B thinkup-$D
16 nice rsync $T/$B backup::backup
17
18 rm -rf $T