Can "backup ... --json" generate less output?

Hi,

I observe that when I use the command restic --json backup ... generates a lot of JSON lines, with progress info. And a final line with the summary. Is there a solution to skip these intermediate lines, and have only the final one?

I tried playing w/ : --quiet, --verbose=0 and the RESTIC_PROGRESS_FPS env var. W/o much success.

My use case: I have a (node.js) script that launches restic. Because my script needs to swallow a lot of STDOUT has a perf impact. Of about 10%. I mention that I don’t do anything with the JSON content I get. Except for the last line = summary.

Thanks in advance,
Cristian.

2 Likes

I was wondering the same.
I write the output to a log file and take the last line.
When i first backup a big mailstore the log gets giant.
Just want to know if the backup was successful.

If all you want is to know if the backup was successful, just check the return value. It is 0 on sucess.

1 Like

In my case, I send this info to a “healthchecks.io” account. Sending info such as “duration”, “size of repo”, “size of copied files”: is not bad. So only checking for the return code is a bit too few.

1 Like

Thanks!
Just add the return value to my script.
I also use the summary to see if things change.

This seems to work:
/usr/bin/restic -r rest:https://serv … /scripts –json | tail -10 >> /var/log/BackupRS.log
log=$(/usr/bin/tail -n 10 “/var/log/BackupRS.log”)