New user here. I’m trying to migrate our backup processes from other tools and scripts. Really enjoying restic (and resticprofile) so far!
But I’m unclear on something.
We currently specify include/exclude paths in external files. That is supported by restic via --files-from includes --exclude-file excludes
.
Suppose includes
has this:
/srv/app/aaa
/srv/app/bbb
I perform two backups. The output of restic snapshots
:
ID Time Host Tags Paths Size
----------------------------------------------------------------
ef9f49a7 2024-09-30 07:17:33 demo /srv/app/aaa 198.197 KiB
/srv/app/bbb
2d8c6801 2024-09-30 07:18:11 demo /srv/app/aaa 198.197 KiB
/srv/app/bbb
I add /srv/foo/ccc
to the includes
file, and perform three backups. Snapshots:
ID Time Host Tags Paths Size
----------------------------------------------------------------
ef9f49a7 2024-09-30 07:17:33 demo /srv/app/aaa 198.197 KiB
/srv/app/bbb
2d8c6801 2024-09-30 07:18:11 demo /srv/app/aaa 198.197 KiB
/srv/app/bbb
995b881f 2024-09-30 07:25:17 demo /srv/app/aaa 248.147 KiB
/srv/app/bbb
/srv/app/ccc
09e9c87a 2024-09-30 07:25:49 demo /srv/app/aaa 248.147 KiB
/srv/app/bbb
/srv/app/ccc
71f731e3 2024-09-30 07:25:57 demo /srv/app/aaa 248.147 KiB
/srv/app/bbb
/srv/app/ccc
Now I perform a forget (and prune), keeping only the last 2 snapshots (--keep-last 2
).
I expect it to delete snapshots 1, 2 and 3, but it actually deletes snapshot 3 only.
It seems to only forget/prune snapshots that exactly match the current includes/excludes config. Since snapshots 1 and 2 don’t include ccc
, it never deletes them.
That’s unexpected and confusing. Am I using restic incorrectly?