]> git.openstreetmap.org Git - chef.git/blob - cookbooks/mailman/templates/default/backup.cron.erb
Tar backup still returns error, ignore for now
[chef.git] / cookbooks / mailman / 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 lists.XXXXXXXXXX)
10 D=$(date +%Y-%m-%d)
11 B="lists-$D.tar.zst"
12
13 mkdir "$T/lists-$D"
14 ln -s /var/lib/mailman "$T/lists-$D/mailman"
15
16 set +e
17 nice tar --create --dereference \
18     --warning=no-file-changed \
19     --warning=no-file-removed \
20     --ignore-failed-read \
21     --exclude='*/archives/*.txt.gz' \
22     --directory="$T" \
23     --sort=name \
24     "lists-$D" | nice zstd --quiet --long --rsyncable -o "$T/$B"
25
26 nice rsync --preallocate --fuzzy "$T/$B" backup.openstreetmap.org::backup
27
28 rm -rf "$T"