How to forget and prune snapshots for specific host?

Hi. I have repository which contains snapshots for multiple hosts. I want to remove/forget/prune all snapsots that belongs to How can I do this? I read documentation here but still don’t understand how to do this Removing backup snapshots — restic 0.16.2 documentation

The option to limit the delete operation to snapshots to a specific host is --host hostname.

But I couldn’t find an option to remove all snapshots in one go, too. I think the best approach would be to delete all but one snapshot, and then delete the last one too.

So e.g.:

  1. Forget all but one snapshot:
    restic forget --host --keep-last 1 (unfortunately --keep-last 0 does not seem to work)
  2. Find the last snapshot ID:
    restic snapshots --host
  3. Forget the last snapshot using the ID from above:
    restic forget <ID>
  4. Optional: Clean all now obsolete data from the repository:
    restic prune
1 Like


It is declared as bug, but with current restic you can do
restic forget --host --keep-tag=SomeUnusedTag

Always ensure you are using --dry-run until you are satisfied with the result!

1 Like

That worked, thanks!