The --group-by
option is for when you want to delete snapshots, not create them. As long as you have the disk space, there isn’t any rush to think about this now; get comfortable with the restic backup
process first, and then start learning about snapshot deletion and --group-by
here.
The challenge you’re facing right now is only about optimizing your backup process. It needs some additional info if you want it to run as fast as possible.
The presence of a parent snapshot speeds-up a backup because it gives restic something to compare against to quickly find the changes that need saving. The command usage is listed with restic backup --help
. To be clear, your repo will be in the same state after a backup is run, irrespective of whether a parent was found automatically, or manually specified, or not used at all (and irrespective of which snapshot is used as a parent); this is just about backup speed.
In most use-cases restic will automatically find an appropriate parent, so there’s nothing you need to specify. In your case, as @fd0 says above, it’s failing to automatically find a parent because you’ve changed your list of target directories to backup (which is a perfectly OK thing to do). So you have two choices:
- Keep doing what you’re currently doing, and don’t stress that the first backup using a different combination of directories is slower. Subsequent backups with that combination will be faster.
- Optimize things as much as possible from the start by manually specifying a parent snapshot whenever you want to backup a different combination of directories. Choose your desired parent from the list provided by
restic snapshots
. Specify the chosen snapshot ID as a parent when you run thebackup
command.