Open Bladtman242 opened 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...
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.
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.