Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Backup Prune ? #1

Open
leonorpw opened this issue Nov 29, 2018 · 2 comments
Open

Question: Backup Prune ? #1

leonorpw opened this issue Nov 29, 2018 · 2 comments

Comments

@leonorpw
Copy link

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

@Nold360
Copy link
Owner

Nold360 commented Dec 5, 2018

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.

@heavygale
Copy link

@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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants