digint / btrbk

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

How to log the actual transfer size reported by btrbk? #518

Open ceremcem opened 1 year ago

ceremcem commented 1 year ago

Partly related to #280

I try to capture all logs in order to parse later to get statistics, like so:

btrbk -c conf.calculated --progress -v run | tee mylog.txt

However, the transfer size information is not present in the mylog.txt. How can I redirect the summary: 50.7 MiByte in 4.0sec - average of 12.6 MiB/s line into the log file?

Caedis commented 1 year ago

In case you have not found the answer, mbuffer is what is creating the progress text and it writes it to stderr (fd 2)

/szaydel/mbuffer/blob/master/mbuffer.c#L159

Oupsman commented 1 year ago

launching the backup with the following command should do the trick :

btrbk -c conf.calculated --progress -v run 2>&1 | tee mylog.txt

ceremcem commented 1 year ago

Can you get the lines with 2>&1 | tee ...:

summary: 18.8 MiByte in  0.4sec - average of 51.9 MiB/s                                                                                                                                          

Because I'm using exact same command btrbk -c conf.calculated --progress -v run 2>&1 | tee mylog.txt and it doesn't log those summary lines.