]> git.openstreetmap.org Git - chef.git/blob - cookbooks/community/templates/default/backup.cron.erb
Add command usage and extra command aliases to nftables script
[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 export ZSTD_CLEVEL=11
6 export ZSTD_NBTHREADS=0
7
8 T=$(mktemp -d -t -p /var/tmp community.XXXXXXXXXX)
9 D=$(date +%Y-%m-%d)
10 B="community-$D.tar.zst"
11
12 mkdir "$T/community-$D"
13 ln -s /srv/community.openstreetmap.org/docker/containers "$T/community-$D/containers"
14 ln -s /srv/community.openstreetmap.org/shared/web-only "$T/community-$D/shared-web-only"
15 ln -s /srv/community.openstreetmap.org/shared/data/redis_data "$T/community-$D/shared-data-redis_data"
16 ln -s /srv/community.openstreetmap.org/shared/data/postgres_backup "$T/community-$D/shared-data-postgres_backup"
17
18 nice tar --create --numeric-owner --dereference --directory="$T" --warning=no-file-changed "community-$D" | nice zstd --quiet --rsyncable -o "$T/$B"
19 nice rsync --preallocate --fuzzy "$T/$B" backup.openstreetmap.org::backup
20
21 rm -rf "$T"