2018-07-03 05:27:50 +00:00
|
|
|
#jinja2:lstrip_blocks: True
|
2017-10-01 17:24:50 +00:00
|
|
|
#!/bin/bash
|
2019-07-11 20:08:09 +00:00
|
|
|
usage(){
|
|
|
|
cat << EOL
|
2017-10-01 17:24:50 +00:00
|
|
|
|
2019-07-11 20:08:09 +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
|
|
|
|
2019-07-11 20:08:09 +00:00
|
|
|
EOL
|
|
|
|
}
|
2018-07-03 05:27:50 +00:00
|
|
|
|
2019-07-11 20:08:09 +00:00
|
|
|
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")
|
2018-07-03 05:27:50 +00:00
|
|
|
|
2019-09-26 21:08:04 +00:00
|
|
|
run-parts --lsbsysinit ~{{ borgbackup_management_user }}/prune.d
|
2017-10-01 17:24:50 +00:00
|
|
|
|