When a nightly backup suddenly takes much longer, or the repository grows a lot more than usual, I want to know one thing: what changed? restic can tell you without restoring anything.
List the snapshots to get their IDs, then compare two of them:
restic -r sftp:[email protected]:/restic-repo snapshots
restic -r sftp:[email protected]:/restic-repo diff 5845b002 2ab627a6
The output lists every path that differs, with a character in front: + added, - removed, M file content changed, T entry type changed. A ? means restic detected bitrot. Underneath you get a short statistic with new, removed and changed files and directories, and how much data was added to and removed from the repository.
For appdata I’d narrow it down to one folder with the snapshot:subfolder syntax, where the subfolder is a path inside the snapshot as restic ls shows it:
restic -r sftp:[email protected]:/restic-repo diff 5845b002:/mnt/user/appdata 2ab627a6:/mnt/user/appdata
If one container’s folder fills the list with thousands of changed cache files or thumbnails, that folder is a good candidate for an exclude. You can also write latest instead of an ID.
One caveat: by default diff only reports changes in file contents. Files whose permissions or owner changed don’t show up unless you add --metadata, and then they get a U. Keep that in mind after a big chown or chmod on a share, which changes a lot of metadata and no content at all.
Further reading: restic docs: comparing snapshots