]> git.openstreetmap.org Git - chef.git/blob - cookbooks/blog/templates/default/backup.cron.erb
Treat php-fpm as an upstart service on 14.04
[chef.git] / cookbooks / blog / 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 osm-blog.XXXXXXXXXX)
6 D=$(date +%Y-%m-%d)
7 B=osm-blog-$D.tar.gz
8
9 mkdir $T/osm-blog-$D
10 mysqldump --user=osm-blog-user --password=<%= @passwords["osm-blog-user"] %> --opt osm-blog > $T/osm-blog-$D/osm-blog.sql
11 ln -s /srv/blog.openstreetmap.org $T/osm-blog-$D/www
12
13 export GZIP="--rsyncable -9"
14 export RSYNC_RSH="ssh -ax -c arcfour"
15
16 nice tar --create --gzip --dereference --directory=$T --file=$T/$B osm-blog-$D
17 nice rsync $T/$B backup::backup
18
19 rm -rf $T