Understanding Expansion, Paths and Pruning

I have restic running but I wanted to understand my situation a little better. I have the following command for my backups:

restic backup /path1 /path2/backup.*

Path 2 has log files, so I end up with one snapshot having:

/path1
/path2/backup.sh
/path2/backup.log

Then for the next snapshot it has:

/path1
/path2/backup.sh
/path2/backup.log
/path2/backup.log.1.gz

Does this mean that the forget command is going to group those two snapshots as separate when it looks for things to prune?

Yes, those are fully separate. Path is one of the criteria’s which have to match.

It might be better to backup the parent folder, rather than individual files. And use exclude/include patterns to select files that should be backupped.

Note that you can change the default behavior by using the --group-by option to the forget command. That way you can make restic not consider paths when it groups snapshots before forgetting. You can also use the --dry-run option to test these things.

Ok, this sounds like the best approach to me.

Thanks