Restic: Add a 'verbose' log level that logs just what happened

Created on 23 May 2018  ·  3Comments  ·  Source: restic/restic

The new restic 0.9.0 has improved logging with four levels of detail:

  1. --quiet -> nothing (except errors)
  2. just completion stats
  3. --verbose or -v -> major steps and completion stats
  4. --verbose --verbose or or -v 2 -> major steps, all files, completion stats

However, none of these level logs just what files got backed up. Just -v doesn't log files, and -v -v logs every file even those that are not being backed up (unmodified).

My suggestion was to add a level that logs just what happens during the run, ie. files that are added, modified, or deleted in this snapshot, e.g.

  1. --quiet -> nothing (except errors)
  2. just completion stats
  3. --verbose or -v -> major steps and completion stats
  4. --verbose --verbose or or -v 2 -> major steps, added/modified/deleted files completion stats
  5. --verbose --verbose --verbose or or -v 3 -> major steps, all files, completion stats

Alternatively log feature labels could be used, to turn options on/off, e.g.

--log=scan,added,modified,deleted,unmodified,totals,stats

And so just to log files backed up with no totals at the end you could use

--log=added,modified,deleted

If you just want totals, you could use

--log=totals

And the --verbose options would map to some preset combinations of log features.

The stats option would enable details per-file stats, with total file size and size actually backed up, and upload times.

user interface feature suggestion

Most helpful comment

I'd really appreciate this feature too. It would make what I'm trying to do here:

https://forum.restic.net/t/script-restic-diff-between-the-last-two-snapshots/1378/6

soooo much easier. Thanks!

All 3 comments

Thanks for the suggestion, I'd like to think about it for a bit.

I'd really appreciate this feature too. It would make what I'm trying to do here:

https://forum.restic.net/t/script-restic-diff-between-the-last-two-snapshots/1378/6

soooo much easier. Thanks!

This would be great! Here's an emulation of the new version of --verbose=2 (i.e. ignore unchanged) using grep:

restic --repo /path/to/repo backup --verbose=2 ~/ | grep -Ev '^unchanged /'
Was this page helpful?
0 / 5 - 0 ratings