]> git.openstreetmap.org Git - chef.git/blob - cookbooks/community/templates/default/backup.cron.erb
Remove grindtooth fragments
[chef.git] / cookbooks / community / 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 community.XXXXXXXXXX)
6 D=$(date +%Y-%m-%d)
7 B=community-$D.tar.gz
8
9 mkdir $T/community-$D
10 ln -s /srv/community.openstreetmap.org/docker/containers $T/community-$D/containers
11 ln -s /srv/community.openstreetmap.org/shared/web-only $T/community-$D/shared-web-only
12 ln -s /srv/community.openstreetmap.org/shared/data/redis_data $T/community-$D/shared-data-redis_data
13 ln -s /srv/community.openstreetmap.org/shared/data/postgres_backup $T/community-$D/shared-data-postgres_backup
14
15 export RSYNC_RSH="ssh -ax"
16
17 nice tar --create --numeric-owner --dereference --directory=$T --warning=no-file-changed community-$D | nice gzip --rsyncable -9 > $T/$B
18 nice rsync --preallocate --fuzzy $T/$B backup::backup
19
20 rm -rf $T