Python Forum

Full Version: logging values from constantly updating CLI app
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I use rclone to transfer large files to my cloud bucket. The upload command takes a flag that shows a constantly updating transfer speed readout in the terminal window (see image link at bottom). It looks like it updates about once every second.

Strategically what I want to do is make a graph of speed vs elapsed time. Initially I would guess I'd need to write the displayed values to a text or csv. Is there any module that can do this?

Thanks so much

Joe

https://i.imgur.com/fUlmMin.png
From what I've read, rclone doesn't produce any output (unless you are doing rclone cat) but it does log to stderr. Try running rclone and redirecting stderr to a file.
Output:
rclone copy /local/path remote:path 2> statistics.txt
Look at the statistics.txt file. Does it contain the information you need?

If the file contains the information you want, there are many things you could do. You could process the file after the rclone command is complete and produce a file that could be used for making plots. Maybe save the data in CSV format so it could be opened in excel, or use plotting tools available in Python. You could read the log information as it is produced and update a live plot. The live plot could be a pretty Matplotlib plot, or it could be a simple ASCII bar chart.