Hi guys,
first of all, thank you for a brilliant backup tool!
My question relates to the flexibility of the --group-by
function for the snapshots
command. A short explanation: in my setup, i have various backup tasks (each with an ID) and each time a task executes (a task execution), it performs a restic backup
command and each snapshot is tagged with the ID of the backup task and the ID of the task execution (thus each snapshot will have two tags, e.g. “backup-task-2” and “task-execution-11”).
Now, before each execution, I need to determine the snapshot ID of the last task execution so that I can set that as the parent for the new snapshot to be created. Since the paths to be backed up for a backup task can change over time, I must set the parent manually as otherwise the parent would be based on the paths (which can change between task executions).
Thus, to find the latest snapshot for backup task with for example ID = 2, I cannot group by tags or by paths, so therefore I need to run
restic snapshots --tag backup-task-2 --group-by host --last
Now, if ever I need to rename my machine, this method will fail as it will output multiple snapshots for multiple hostnames.
Possible ways in which restic could help to solve such problems:
- allow specifying hostname manually for backup command or changing hostname of existing snapshots
- when specifying both
--group-by tags
as well as a--tag
to filter by, it could allow grouping only by the specified tag(s) and not the other tags present on each snapshot (I can imagine this to be very useful for others too) - allow disabling of grouping entirely, only filtering by provided tags e.g.