]> git.openstreetmap.org Git - chef.git/blob - cookbooks/mailman/templates/default/backup.cron.erb
Merge remote-tracking branch 'github/pull/781'
[chef.git] / cookbooks / mailman / 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 lists.XXXXXXXXXX)
9 D=$(date +%Y-%m-%d)
10 B="lists-$D.tar.zst"
11
12 mkdir "$T/lists-$D"
13 ln -s /var/lib/mailman "$T/lists-$D/mailman"
14
15 nice tar --create --dereference \
16     --warning=no-file-changed \
17     --warning=no-file-removed \
18     --exclude='*/archives/*.txt.gz' \
19     --directory="$T" \
20     "lists-$D" | nice zstd --quiet --rsyncable -o "$T/$B"
21
22 nice rsync --preallocate --fuzzy "$T/$B" backup.openstreetmap.org::backup
23
24 rm -rf "$T"