]> git.openstreetmap.org Git - chef.git/blob - cookbooks/mailman/templates/default/backup.cron.erb
build(deps): bump test-kitchen from 3.9.0 to 3.9.1
[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 nice tar --create --dereference \
17     --warning=no-file-changed \
18     --warning=no-file-removed \
19     --exclude='*/archives/*.txt.gz' \
20     --directory="$T" \
21     --sort=name \
22     "lists-$D" | nice zstd --quiet --long --rsyncable -o "$T/$B"
23
24 nice rsync --preallocate --fuzzy "$T/$B" backup.openstreetmap.org::backup
25
26 rm -rf "$T"