ansible-borgbackup/templates/prune.sh.j2

21 lines
471 B
Plaintext
Raw Normal View History

#jinja2:lstrip_blocks: True
2017-10-01 17:24:50 +00:00
#!/bin/bash
usage(){
cat << EOL
2017-10-01 17:24:50 +00:00
This script is intended to run on a trusted management station to purge borg repo's in
append-only mode.
Don't put it on the backup server, it contains all borg secrets!
2017-10-01 17:24:50 +00:00
EOL
}
DATE=$(date +%y%m%d)
LOG_DIR=/var/log/borgbackup
[ ! -d $LOG_DIR ] && mkdir $LOG_DIR
LOG_FILE=/var/log/borgbackup-prune/${DATE}.log
exec &> >(tee "$LOG_FILE")
run-parts --lsbsysinit ~{{ borgbackup_management_user }}/prune.d
2017-10-01 17:24:50 +00:00