How to efficiently review changes before running a new backup snapshot

Hi all,

as I am still in the first days of setting up my backup routines with restic, I find myself frequently wanting to review local changes that restic would include in a new backup snapshot.

Although the main reason for that is checking and tuning my include/exclude rules, I sometime just want to check last day changes, and ensure that nothing was forgotten. Maybe my brain has been too used to git (& co), but I really want to find a way to do that efficiently.

So far, the best that I found is something looking like below :

restic (...) backup --dry-run --verbose | grep -v "^unchanged"

This somewhat works but is suboptimal :

  • grep-ing to drop about 99% of input lines feels wrong
  • once my review is done, I must restart the whole thing without --dry-run, which is CPU and IO intensive.

What I would love is to have a summary of “what changes will be snapshot”. Colors would be awesome.

  • files added
  • files modified
  • files deleted

Then restic would halt and ask for confirmation to proceed, so it does not have to scan everything twice.

That means “interactive mode” somewhat.

What is your opinion of this topic ? Is there something that I have missed so far ?

Cheers

1 Like
  • grep-ing to drop about 99% of input lines feels wrong

I guess that is just how grep works.

  • once my review is done, I must restart the whole thing without --dry-run, which is CPU and IO intensive.

I don’t think you will find any other method of achieving this without going through all files again when you actually want to execute. Except maybe some file system level snapshot method.

So you probably already found the best way of doing this! It’s even beautiful, because it’s a real Un*x solution: using little tools that each have their specialty in a row.

That said, you could also just run the backup and then see what was backed up. There is no real benefit in waiting until there are “enough changes” and additional snapshots don’t waste much space because of the way restic works.

2 Likes

Relax and don’t overdo it :smiley:

  • Identify the folders that contain what you want to backup, on a high level such as ~ or ~/Documents or whatever is your main storage area.
  • Add excludes where it makes sense - personally I only add them when there’s a lot of data in some folder (e.g. if I download 10 GB of images or a huge source code repository that I don’t really care about as it’s just working material, I add a CACHEDIR.TAG file in that folder, so exclude it from backups).
  • Trust the system, but check that what’s backed up is what you expect at least initially.
  • Try restoring random files every now and then to verify your backups work.
3 Likes

Thank you @nicnab and @rawtaz. I will keep doing it this way then.