Open mhansen opened 6 months ago
After https://github.com/restic/restic/pull/4705 is merged, this shouldn't be too hard to implement. The console output of backup
and restore
are independent enough to not pose a problem here.
However, I can imagine that the output could be too verbose by default, but it is probably okay for backup -v
.
What should restic do differently? Which functionality do you think we should add?
Restic has a curses-style CLI status line that updates a few times a second as the backup is happening, with time, total scanned size, total directory size. e.g.:
I propose adding the 'total bytes added to repository so far' statistic to this line.
This is printed out at the end:
But it would be reassuring to also print this during the backup.
As an extension, most of the other statistics would be great to show during the backup too:
What are you trying to do? What problem would this solve?
I'm backing up my Google Photos with Google Takeout every 2 months. Any given backup has very little new data. I'd like to see while I'm backing up how much new data has been added to the repository, so (mostly) I can be confident that it's working, and (less likely) Ctrl-C if it's backing up too much new stuff.
Did restic help you today? Did it make you happy in any way?
Yeah, restic rules. Love that it's open-source, deduping, cross-platform, and fast. It's how I'm backing up my Google Photos: https://www.markhansen.co.nz/google-photos-backup/
Code pointers
Here's the code that prints the status line: https://github.com/restic/restic/blob/d1d773cfcd3115aecbbd6ad6be2bc5e11f395b29/internal/ui/backup/text.go#L51
I see this doesn't have easy access to the total bytes added to the repository; it would need to be plumbed from https://github.com/restic/restic/blob/master/internal/ui/backup/progress.go#L88 (and even further back).
I see this is used by both backup and restore commands. Maybe not all statistics make sense for both commands.