]> git.openstreetmap.org Git - chef.git/blob - cookbooks/blog/templates/default/backup-birthday20.cron.erb
Fully qualify the name of the backup server
[chef.git] / cookbooks / blog / templates / default / backup-birthday20.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 osm-birthday20.XXXXXXXXXX)
6 D=$(date +%Y-%m-%d)
7 B=osm-birthday20-$D.tar.gz
8
9 mkdir $T/osm-birthday20-$D
10 echo '[mysqldump]' > $T/mysqldump.opts
11 echo 'user=osm-birthday20-user' >> $T/mysqldump.opts
12 echo 'password=<%= @passwords["osm-birthday20-user"] %>' >> $T/mysqldump.opts
13 mysqldump --defaults-file=$T/mysqldump.opts --opt --no-tablespaces osm-birthday20 > $T/osm-birthday20-$D/osm-birthday20.sql
14 ln -s /srv/birthday20.openstreetmap.org $T/osm-birthday20-$D/www
15
16 export RSYNC_RSH="ssh -ax"
17
18 nice tar --create --dereference --directory=$T --warning=no-file-changed osm-birthday20-$D | nice gzip --rsyncable -9 > $T/$B
19 nice rsync --preallocate --fuzzy $T/$B backup.openstreetmap.org::backup
20
21 rm -rf $T