Sticky & hidden snapshots


I would like to suggest sticky & hidden snapshots.

If you guessed it right

Sticky : prevent accidental deletion of snapshots. So only delete normal snapshots

Hidden: hide snapshots in Normal output of restic snapshots

instead show not hidden snapshots (at the end)
Showing 50 / 300

restic sticky (snapshot Id)
restic hide (snapshot Id)
restic nonsticky (snapshot id)
restic unhide (snapshot id)
The above mentioned commands should do as it says

To view hidden / sticky snapshots specifically
restic snapshots sticky
restic snapshots hidden

Output of restic snapshots should only hide hidden snapshots sticky & normal should be viewed.

Commands prune & check should not be affected by this.


Would you care to elaborate what usecase you have for hidden snapshots?
In regards to sticky snapshots one should make plenty of use of the --dry-run flag when working with forget.

when snapshots counts grow larger with a host / tag it’s a huge dump on screen.
So in other words restic snapshots would dump like only most recent snapshots on screen.

Incase of forgot snapshots there should be a warning message before deleting. with grep only that snapshot I’d in view.

Have you tried restic snapshots --last yet? This would output exactly what you are looking for; the last available snapshot for a given host.
The helptext for this is:
--last only show the last snapshot for each host and path

I think that’s exactly a usecase for the --dry-run flag when working with a forget policy.
Then you would get the output what restic would’ve done when running the forget policy without actually applying it. So I don’t think there is a need for more commands right now.

Using --tag with restic backup you could add a “volatile” tag to backups which you do not want to be sticky. You can also use restic tag to add/remove such a tag after the backup.

When running forget, have it only consider snapshots with the volatile tag via --tag volatile. Sticky snapshots!