digint / btrbk

Tool for creating snapshots and remote backups of btrfs subvolumes
https://digint.ch/btrbk/
GNU General Public License v3.0
1.72k stars 124 forks source link

Consider outputing progress information, even when output is redirected. #139

Open Bladtman242 opened 7 years ago

Bladtman242 commented 7 years ago

It seems btrbk uses pv to indicate progress. pv does not output progress when the output is redirected. This means that when btrbk is used in an automated fashion, e.g. with systemd timers, the log will not show progress. This might make sense in some use cases, but for long running backups it can be a problem, especially as btrbk can stall when network problems are encountered, leaving the user to guess whether btrbk has stalled, or is running a long backup. Maybe an option could be added to use pv's -n flag? This gives a lot more output, but would allow users to monitor btrbk progress in logs. As a bonus; pv's output could be filtered, to give less output than the -n option does.

digint commented 7 years ago

As I don't like to add too many options to btrbk (there's already a lot...), maybe it would be better to have btrbk find out if stdout is on a terminal, and if it's not, automagically add the pv -n flag.

I'm afraid I have very little time at the moment, so please be patient on this...

Bladtman242 commented 7 years ago

That would be even better, I think! I'm sorry I can't make a PR, but I have no experience with perl, so I'd probably do more harm than good.