realestatepilot / docker-restic-backupclient

Easy backups with docker and restic
MIT License
5 stars 5 forks source link

Feature Request: extra schedule for prune #2

Open tgruenert opened 4 years ago

tgruenert commented 4 years ago

at a 15 TB archive a 'prune' takes a very long time. this run´s almost after every backup.

it would nice to have a configurable schedule for prune independent from the schedule for backup. In my case a prune is not necessary after every backup.

micw commented 2 years ago

At the moment, due to single scheduling, we cannot get any conflicts between prune and backup. If we have multiple schedules,

Another way (with potentially fewer side effects) would be to have some option that checks how many recent backups are there and prunes only if that exceeds a certain number.

Edit: is this only about the "prune" command which is part of the "forget" run or is it for both, forget and "prune"?

tgruenert commented 2 years ago

Thank you for your questions. I would follow the idea of prune / forget after x successful backups.

I think scheduling should be done for prune because this is the time consuming operation. Forget can run every time after backup.

micw commented 2 years ago

The current master contains a version with separated prune. It is usually ran after the beackup, except you pass a crontab like `--prune '0 19 *'``

Note that a backup is skipped if a prune runs on it's schedule and vice versa. There is an example in the docs.

Also a new option RESTIC_PRUNE_TIMEOUT has been added that allows to terminate pruning if it takes too long.