]> git.openstreetmap.org Git - chef.git/blob - cookbooks/civicrm/templates/default/backup.cron.erb
Make sure resolv.conf is using the systemd-resolved stub resolver
[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 echo '[mysqldump]' > $T/mysqldump.opts
11 echo 'user=civicrm' >> $T/mysqldump.opts
12 echo 'password=<%= @passwords["database"] %>' >> $T/mysqldump.opts
13 mysqldump --defaults-file=$T/mysqldump.opts --opt --skip-lock-tables civicrm > $T/osmf-crm-$D/civicrm.sql
14 ln -s /srv/join.osmfoundation.org $T/osmf-crm-$D/www
15
16 export GZIP="--rsyncable -9"
17 export RSYNC_RSH="ssh -ax"
18
19 nice tar --create --gzip --dereference --directory=$T --file=$T/$B osmf-crm-$D
20 nice rsync --preallocate --fuzzy $T/$B backup::backup
21
22 rm -rf $T