in our tool git-annex-remote-rclone we are using rclone copy
for transferring content for annex into remotes. git-annex allows for our tool to report progress back to it in bytes, but ATM it is not trivial to establish monitoring of the rclone copy
process regarding its progress: it requires parsing already humanized sizes from either stdout which likely to also carry ANSI characters, and looking for smth like Transferred: 411.125 MiB / 953.674 MiB
and then converting MiB "manually" into pure bytes.
Or alternative is to configure it dumping into a log file at DEBUG level and then monitoring that file for Transferred: \t 953.674 MiB / 953.674 MiB
and do similar dance with conversion.
In git-annex
a similar design issue was resolved by having --json-progress include progress in JSON output
and then the json record has explicit "byte-progress":16384
field which then could be easily read out and not require any conversion. Here is a more complete example of how such progress reports look like
(dandisets) dandi@drogon:/tmp/ds000003$ git annex get --json-progress sub-01/anat/sub-01_*
{"byte-progress":15854,"action":{"command":"get","note":"from s3-PUBLIC...","input":["sub-01/anat/sub-01_inplaneT2.nii.gz"],"key":"MD5E-s664614--0f8bc47f9c3047b340abfcd3ce1fb021.nii.gz","file":"sub-01/anat/sub-01_inplaneT2.nii.gz"},"total-size":664614,"percent-progress":"2.39%"}
{"byte-progress":432622,"action":{"command":"get","note":"from s3-PUBLIC...","input":["sub-01/anat/sub-01_inplaneT2.nii.gz"],"key":"MD5E-s664614--0f8bc47f9c3047b340abfcd3ce1fb021.nii.gz","file":"sub-01/anat/sub-01_inplaneT2.nii.gz"},"total-size":664614,"percent-progress":"65.09%"}
{"byte-progress":664614,"action":{"command":"get","note":"from s3-PUBLIC...","input":["sub-01/anat/sub-01_inplaneT2.nii.gz"],"key":"MD5E-s664614--0f8bc47f9c3047b340abfcd3ce1fb021.nii.gz","file":"sub-01/anat/sub-01_inplaneT2.nii.gz"},"total-size":664614,"percent-progress":"100%"}
{"command":"get","note":"from s3-PUBLIC...","success":true,"input":["sub-01/anat/sub-01_inplaneT2.nii.gz"],"key":"MD5E-s664614--0f8bc47f9c3047b340abfcd3ce1fb021.nii.gz","error-messages":[],"file":"sub-01/anat/sub-01_inplaneT2.nii.gz"}
{"byte-progress":16384,"action":{"command":"get","note":"from s3-PUBLIC...","input":["sub-01/anat/sub-01_T1w.nii.gz"],"key":"MD5E-s5712417--0d1e0a7ff7063250404f45a955a66203.nii.gz","file":"sub-01/anat/sub-01_T1w.nii.gz"},"total-size":5712417,"percent-progress":"0.29%"}
{"byte-progress":5712417,"action":{"command":"get","note":"from s3-PUBLIC...","input":["sub-01/anat/sub-01_T1w.nii.gz"],"key":"MD5E-s5712417--0d1e0a7ff7063250404f45a955a66203.nii.gz","file":"sub-01/anat/sub-01_T1w.nii.gz"},"total-size":5712417,"percent-progress":"100%"}
{"command":"get","note":"from s3-PUBLIC...","success":true,"input":["sub-01/anat/sub-01_T1w.nii.gz"],"key":"MD5E-s5712417--0d1e0a7ff7063250404f45a955a66203.nii.gz","error-messages":[],"file":"sub-01/anat/sub-01_T1w.nii.gz"}