]> git.openstreetmap.org Git - chef.git/blob - cookbooks/civicrm/templates/default/backup.cron.erb
202469c877b98db35659cd8a9ff93bdf4967f671
[chef.git] / cookbooks / civicrm / 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 osmf-crm.XXXXXXXXXX)
6 D=$(date +%Y-%m-%d)
7 B=osmf-crm-$D.tar.gz
8
9 mkdir $T/osmf-crm-$D
10 mysqldump --user=civicrm --password=<%= @passwords["database"] %> --opt --skip-lock-tables civicrm > $T/osmf-crm-$D/civicrm.sql
11 ln -s /srv/join.osmfoundation.org $T/osmf-crm-$D/www
12
13 export GZIP="--rsyncable -9"
14 export RSYNC_RSH="ssh -ax"
15
16 nice tar --create --gzip --dereference --directory=$T --file=$T/$B osmf-crm-$D
17 nice rsync $T/$B backup::backup
18
19 rm -rf $T