Capture individual elements of the Progress display as variables for a script?

When using rclone copy or sync with -P is it possible to capture elements of the progress screen to a variable or export them to a file?

For example, I'd like to capture 17.422 TBytes and possibly one or two of the other fields in the progress display below:
Transferred: 658.985G / 17.422 TBytes, 4%, 17.535 GBytes/s, ETA 16m19s

It's probably something simple, I'm just not sure what field name/syntax to use.

As a sub-question Is there a general reference for rclone fields that we can access?

Thank you

If you use --stats 1m then rclone will output statistics every 1 minute to the log. You can use --stats-one-line to condense it a bit. Unfortunately those are incompatible with -P which uses the same mechanism.

You might be better off using the api and reading the stats from there

Thanks @ncw. Sorry I should have been more specific.

I use stats and logs already. I was asking if there is any way to extract a specific data field from what is shown in the progress screen to use as input for a script rather than dumping the full text to the log. In the example above that would mean capturing only 17.422 TBytes as a variable or to a file.

Scraping from the script would be a bit tough. Much easier via the rc commands.

Animosity, thanks. In rc core stats I see "bytes" for amount transferred, but not a field for the total that is being transferred (in the above example the 17.422 TBytes. That's the bit I'm after.

I think that is missing at the moment. There is an issue and a pull request open about fixing this though!

Wonderful, thank you ncw. :+1:

It's not a big deal. But can be useful for managing SA rotation in some of my scripts.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.