Question: Backup Prune ?
leonorpw opened this issue · 2 comments
Hello, is there any nice way to add something like to the build?
for i in $(ls $BORG_DATA_DIR/)
do
echo "###### Pruning backup for $i on $(date) ######"
borg prune -v $BORG_DATA_DIR/$i --keep-daily=7 --keep-weekly=4 --keep-monthly=6
done
I tried to add cron and run it, but i didn't get it working
Hi,
this should definitely work, if you have borg installed on your host system & run this script via your hosts crontab. A cron inside of the container doesn't exist.
Also i guess it's best practice to let your clients prune their repo. Otherwise you might lock the repo, when your client wants to backup.
@leonorpw: you might want to have a look at the "prune" branch in my fork. It's a "prune cronjob only"-version of the image with no ssh-server installed, so that the repokey passphrases are seperated from the regular container which is accessable via ssh.
And I modified the "master" branch, so that it's possible to define certain sshkeys as "managers" (allowed to prune/delete archives), while all other sshkeys can still be restricted with "--append-only".