So, yesterday I put my big restic backup job in a cron script, obviously redirecting stderr/stdout to a file so I could get at them while the backup is running instead of getting them only in the very large resulting cron email when the job finishes.
But, when I did that, I unexpectedly lost the “progress” messages that restic generates to the terminal, ie the ones like these are no longer being generated:
[11:07:59] 81.18% 14645061 files 18.689 TiB, total 33188999 files 23.021 TiB, 0 errors ETA 2:34:49 [12:07:59] 85.63% 18086766 files 19.712 TiB, total 33188999 files 23.021 TiB, 0 errors ETA 2:02:12 [13:07:59] 86.81% 22700045 files 19.985 TiB, total 33188999 files 23.021 TiB, 0 errors ETA 1:59:41
I guess restic stops writing them when it senses it is no longer connected to a terminal (perhaps because in that case it has no termcap to reposition the cursor after printing them?). But even without termcap, they would be most useful, even vital here for me to monitor the backup while it’s running.
I’ve checked and restic 0.9.5 has --json, which seems to output this info in a different format even when redirected to a file – but as this log file is not going to be parsed by a computer but rather by me, JSON is too verbose and would just make my job harder.
So, apart from hacking restic’s code to reenable those progress messages even when output is not a terminal, is there any way for me to get these progress messages back?