Repository: restic/restic

Issue #2706: Option for newlines after each progress update
Created: 2020-04-23T21:33:05Z
Output of restic version
restic 0.9.6 compiled with go1.13.4 on linux/amd64
What should restic do differently? Which functionality do you think we should add?
I would like the ability to print a newline at each progress log update.
What are you trying to do?
I'm running restic in Kubernetes, where I'm using the native methods for reading the logs (kubectl logs <restic pod>). Unfortunately in Kubernetes a log line is only presented when the line is terminated with a newline. That means that when I run any restic command, and progress output is continually printed, I cannot see it. I only see the final progress line written.
I ran a prune to clean out some cruft from my backup repository, and I even ran it in verbose mode, but I couldn't see anything but the 3 first lines of log for a while:
created new cache in /root/.cache/restic
counting files in repo
building new index for repo

I waited and waited, and was concerned if anything was actually happening, until ~49 hours later I finally got the next log line:
[48:58:16] 100.00%  581951/581951 packs

It's pretty clear to me that restic has continually printed progress log, but as there never was a newline, I just couldn't see it until it was done.
I haven't tried yet, as I'm still waiting for the prune to finish, but I suspect that the --json parameter would actually give me the progress report in separate lines, but it would also be very nice to have a non-json "print newline for each progress update" mode.
I haven't tried, but I suspect that the same behaviour would happen for plain Docker without Kubernetes.
Bonus request: If this log output method could be controlled via an Environment Variable, it would be even easier to handle in my setup.
Did restic help you today? Did it make you happy in any way?
Yes, restic seems to be a brilliant backup solution, and fits my usecase very well.

Duplicate issue #2265: Periodically print progress information when output device is not TTY
Created: 2019-05-05T05:12:38Z
Output of restic version
restic 0.9.5 compiled with go1.11.6 on linux/amd64

What should restic do differently? Which functionality do you think we should add?
I use restic as a systemd daemon, and I found out that when restic is not outputting to TTY, it does not give me any information about the current progress unless the action is finished. It would be wonderful to have a way to know the progress in this kind of situation.

What are you trying to do?
If this feature is implemented, we can know if restic is hanged or running, and know the progress when doing some time-consuming actions as a, for example, systemd daemon.
Current output:
+ restic prune
counting files in repo
building new index for repo
[1:07:41] 100.00%  25821 / 25821 packs
repository contains 25821 packs (2660207 blobs) with 112.837 GiB
processed 2660207 blobs: 102028 duplicate blobs, 2.071 GiB duplicate
load all snapshots
find data that is still in use for 4 snapshots
[1:27] 100.00%  4 / 4 snapshots
found 1112281 of 2660207 data blobs still in use, removing 1547926 blobs
will remove 0 invalid files
will delete 7384 packs and rewrite 8134 packs, this frees 50.006 GiB
[5:24:04] 100.00%  8134 / 8134 packs rewritten
counting files in repo
[39:08] 100.00%  13977 / 13977 packs
finding old index files
saved new indexes as [e1b57149 84198d5b 4733a8bf 598c99fa d33ccb78]
remove 174 old index files

Expected output:
counting files in repo
[00:00] 0% 0 / 13977 packs
[05:00] 12.82% 1792 / 13977 packs
...
[39:08] 100.00%  13977 / 13977 packs


Did restic help you or made you happy in any way?
Restic is doing a good job :)

Closing comment (2020-11-15T17:16:56Z): Closing this as duplicate of #2706.