Make snapshots --group-by tags more granular

Hello there,

I’m making backups of old files that need to have their date written in. I won’t modify the file names to include the date, so I put the date in a tag, like so: 2022-03-17. I need to do that because I can’t set the date at the snapshot level, and I want to remember the original date. That date is stored with the file, but I can’t easily see it in the list of snapshots.

I also use a tag to describe the component the files are related to, because restoring happens at the component level, so I’ll add something like database.

Thanks to this I can list the snapshots of a component, and see their original dates. This means that all snapshots have 2 tags.

Now if I want to list all snapshots and group by component, I want to use restic snapshots --group-by tag but it list by the combination of all tags. So I’ll have a group for (component1, date1), another group for (component1, date2), etc… Ideally I’d like to group by a single tag.

Is that possible with restic ?

Hmm… did you miss the --time switch?

restic backup --time '2012-11-01 22:08:41' - for example

1 Like

restic 0.17.0 (not yet released) will also offer the ability to change the timestamp of snapshots using restic rewrite --new-time ...

1 Like

Oooooo… what about hostnames? :pray:

$ restic help rewrite
...
      --new-host string      replace hostname
      --new-time string      replace time of the backup
1 Like

ooooh that is amazing, and I’ll definitely use that one. Thanks !

1 Like