How to log the output of restic?

Restic prints some text in terminal, depending on the sub-command. I want to save this text in a file, to check the status later, while simultaneously seeing the running output in the terminal. This is similar to rsync log file.

It seems there is no “—log-file “ flag. How do you do this properly?

Does it work well to pipe the output using “>>”? I want to see the running output as well, because the back up can take a long time.

If that’s not windows, you can use tee like restic command | tee -a mylogfile which should append to file and show it to you at the same time. If you want to see stderr too you can append 2>&1 to the command so it should at least display in case of anything appears there.

1 Like

Thank you! I guess the whole command is:

restic command | tee -a mylogfile 2>&1

It’s good to add a log-file flag.

The redirection should be added to the restic command you want to log if you want to log stderr, too:

restic command 2>&1 | tee -a mylogfile

2 Likes

I still would love to some metadata json file and the plain text live std output at the same time as discussed in these topics: