Hello!
I’m new to Restic and loving it so far… I’m backing up a project directory with 390 GB - the backup repository is only 220 GB - that’s just mindblowing…
Anyway, the question I have is for a specific pruning that I’d like to do on a different backup repository that runs every 10 minutes and that is sort of my safety net in case I mess something up while working so that I have many “old” copies of the files.
Of course I’d like to prune that , but I don’t quite understand the syntax and implications and I don’t trust the LLMs answers for this:
So how would I construct the forget and prune command to:
- keep all snapshots from the past 3 days
- for the 7 days before those 3 days I would like to keep hourly snapshots
- and for the time before those 3 + 7 days weekly.
How would I design this command?
I would suggest you spend some time reading documentation:
For sure some AI help can help but it is very narrow and specific knowledge so AI won’t provide you much more than you can read yourself.
Try to understand it and experiment. --dry-run should be your friend flag:)
probably --keep-within 3d
try --keep-within-hourly 10d
maybe --keep-within-weekly 9999d
Make sure you understand difference between keep and keep-within. If you run your backups all the time there won’t be difference but if you have gaps then difference should become apparent.
Again all is rather clearly explained in docs.
Thank you for your help!
I was overwhelmed by and could not make sense of the documentation and I was never sure if the respective option always referred to relative to the latest snapshot.
I tried with those suggestions with --dry-run . It seems to be doing the right thing. At least according to this output line:
Applying Policy: keep hourly snapshots within 10d, weekly snapshots within 9999d and all snapshots within 3d of the newest
keep 349 snapshots:
Although the output is rather overwhelmingly long… 1055 snapshots had accumulated in the repository… no way for me to go through that in any sensible amount of time to get a feel for what is going to happen…
Hmmm… well, I guess I’m still in experimentation stage. And yes, the fact that Restic has such a good reputation overall of course shows me that I should trust this much more than my cautious self thinks….
1 Like