resticprofile icon indicating copy to clipboard operation
resticprofile copied to clipboard

Is the default for retention and forget to forget all snapshots?

Open hollowhemlock opened this issue 5 months ago • 3 comments

From the documentation the default for each of the following is 0, then says to specify "unlimited" to keep all. Is this a documentation issues or is the default to forget everything? If so would it be better to default to "unlimited"?

Image Image

Retention Documentation

Forget Documentation

hollowhemlock avatar Jul 07 '25 16:07 hollowhemlock

Hey!

This is a great question 😉

The idea here is to keep restic defaults: no flag will be generated on the command line when no option is specified.

You can see if you run the forget command while no policy has been defined:

[...]
2025/07/16 20:25:39 profile 'no-forget': starting 'forget'
2025/07/16 20:25:39 command environment: reusing previous
2025/07/16 20:25:39 starting command: /usr/local/bin/restic forget --password-file=examples/key --repo=/Volumes/RAMDisk/testing --verbose=1
repository 9ef53ef0 opened (version 2, compression level auto)
created new cache in /Users/cp/Library/Caches/restic
Fatal: no policy was specified, no snapshots will be removed
2025/07/16 20:25:40 forget on profile 'no-forget': exit status 1

As you can see, restic refuses to delete any snapshots 👍🏻

This is a great point: I should add this information to the documentation 😄

creativeprojects avatar Jul 16 '25 19:07 creativeprojects

That's reassuring. I read more about it here https://restic.readthedocs.io/en/latest/060_forget.html#removing-all-snapshots.

I can PR for the docs it if it's not generated.

hollowhemlock avatar Jul 17 '25 02:07 hollowhemlock

I can PR for the docs it if it's not generated.

Please do 👍🏻

creativeprojects avatar Jul 17 '25 19:07 creativeprojects