Keep all snapshots with at least one tag when using forget?

I’ve tried using --keep-tags * but it doesn’t work. Is there a way to do this?

Btw I don’t want to forget all the snapshots that doesn’t have any tag, I want that in addition to the snapshots targeted by the other policies all the snapshots with tags also be kept.

--keep-tags doesn’t support wildcards. I guess the only option would be to explicitly list all tags…

Should be pretty simple to do with a bit of scripting :slight_smile:

I’m using --tag “” to handle only snapshots without tags

/opt/restic/restic --repository-file /opt/restic/.restic_repository --password-file /opt/restic/.restic_password forget --keep-within-hourly 3d --keep-within-daily 30d --keep-weekly 12 --keep-monthly 12 --keep-yearly 3 --tag "" --prune
1 Like