Restic logfile - list only changed files?

Hi!

I wonder if there’s an easy way to get a restic logfile which just contains the modified file per snapshot.
If I use --verbose I’ll get a neat status, but its “online” only. Using --verbose=2 could be used to be redirected to a logfile, but that is just too verbose, i.e. lists all unchanged files.
I’m stuck with windows for my machine, so no grep -v on-the-fly possible…

Is there something in between I’m missing? I’d rather not compare snapshots to find out which files changed.

As to why I’d like to have this: I just like to have a quick overview what has recently changed… I’m new to restic and try to monitor it to get the feeling right :slight_smile:

Greetings

Nico

I haven’t tried it, but could some mix with --json work for you?

Hi!

Thanks for the suggestion. Unfortunately --json combined with --verbose does not contain the changed files. And again, combined with --verbose=2 it contains all files, even unchanged ones.

Greetings

Nico

There are several topics in the forum that have methods of getting the changed/added/deleted listing. The following works for me. I use this at the end of the bash script for backups. The script is executed as a cron job so I get the results emailed to myself. If there aren’t a lot of changes then running it from a console is satisfactory.

PREV=$(/usr/bin/restic snapshots --compact | tail -4 | head -1 | awk '{print $1}')
LAST=$(/usr/bin/restic snapshots --compact | tail -3 | head -1 | awk '{print $1}')
/usr/bin/restic diff "$PREV" "$LAST"

Using --json with the jq utility would make the script more robust as well as require one fewer invocations of restic:

Hi!

Thanks for the input :slight_smile:

Greetings

Nico

For anyone searching for a solution to skip the unchanged files and show only the modified/deleted/added files, the best option is to remove the lines that start with unchanged from the output with sed by piping the output of restic to it:

restic backup | sed '/^unchanged/d'

I created a backup.sh that contains this code so I can easily run it without typing over and over.
The benefit of this approach is that the output is live, line after line, but the lines with the unchanged files are simply skipped.