]> git.openstreetmap.org Git - chef.git/blob - cookbooks/community/templates/default/backup.cron.erb
build(deps): bump test-kitchen from 3.9.0 to 3.9.1
[chef.git] / cookbooks / community / templates / default / backup.cron.erb
1 #!/bin/bash
2
3 # DO NOT EDIT - This file is being maintained by Chef
4 set -euo pipefail
5
6 export ZSTD_CLEVEL=11
7 export ZSTD_NBTHREADS=0
8
9 T=$(mktemp -d -t -p /var/tmp community.XXXXXXXXXX)
10 D=$(date +%Y-%m-%d)
11 B="community-$D.tar.zst"
12
13 mkdir "$T/community-$D"
14 ln -s /srv/community.openstreetmap.org/docker/containers "$T/community-$D/containers"
15 ln -s /srv/community.openstreetmap.org/shared/web-only "$T/community-$D/shared-web-only"
16 ln -s /srv/community.openstreetmap.org/shared/data/redis_data "$T/community-$D/shared-data-redis_data"
17 ln -s /srv/community.openstreetmap.org/shared/data/postgres_backup "$T/community-$D/shared-data-postgres_backup"
18
19 nice tar --create --numeric-owner --dereference --directory="$T" --sort=name --warning=no-file-changed --exclude="community-$D/shared-web-only/log/**/*.gz" "community-$D" | nice zstd --quiet --long --rsyncable -o "$T/$B"
20 nice rsync --preallocate --fuzzy "$T/$B" backup.openstreetmap.org::backup
21
22 rm -rf "$T"