I was wondering if someone could share me on what is the difference from forget and prune. I was testing it out and what i think is that forget would just delete the snapshot while prune also deletes any old data that was from that old snapshot? which is located in the folder data?
I’m wondering, is there anything missing in the manual about the two commands? https://restic.readthedocs.io/en/latest/060_forget.html
Were you unable to understand the text?
Thanks for the quick reply, I could not find the doc before but thank you again for the link it was very helpful.
Question though: What’s the use case for forgetting but not pruning? Is there a performance gain or just so you don’t see them in the list, or something else?
from what i understood forget is to remove the snapshot and pruning moves the files that were with that snapshot so i guess there 2 different functions
remember to update to the latest version of restic to see those options
Yeah, I got that, but when would you want to just remove the snapshot while leaving the files behind?
I’d also like to know this. I thought it made sense at first, but in 2 years I’ve never used forget without --prune. I wonder what the use case is?
The two operations do different things:
forget removes the reference for the data stored in the snapshot, and
prune takes care of the low-level reorganisation for the repo. The idea to make them two separate commands was that
forget is cheap (just remove a few files from the repo) whereas
prune can be very expensive to run. So you can run
forget daily, and run
prune only once a week or so.
When you have a single repository which several different machines use, you can run
forget on each machine with
--host set to the host name of the current machine and apply different policies for each host. You can then run
prune on a single host (maybe the one with the best connection to the repo, or the most memory or so).
So, most users will probably run
forget --prune, but there are cases where it makes sense to run the two commands separately.
Neat. So I guess what it comes down to is that you might want your server with the best connection running the
prune commands (because they’re slow and need a lot of network), but you might want the
forget commands run by the individual hosts, so that they can keep their own retention policies and not be required to do the
Neat. I’m glad I asked. Thanks for the explainer.
well at least for what i do is forget and prune at the same time of course i have the forget command every 90 days and haven’t got to 90 days yet