I'm using python 3.3.2 and pysftp to make a back-up utility that stores copies of files on another computer on my network.
I already know how to use pysftp to transfer theses files however i would like to see the progress of the transfer (bytes per second, percent completion, time remaining) instead of some static print statement indicating that the transfer has started or finished
something like this maybe ( filename: 3.4MiB/s | 40%<#########=============> | 0:03:54 remaining )
Edit: I could probably build a progress bar if i just knew how to get pysftp's put command to yeild the information, THAT is what i want to know how to do
Edit: I think i found my answer on another question after extensive digging:
How to see (log) file transfer progress using paramiko?
There exists a call back function in both get/put methods (see the official documentation)
get(remotepath, localpath=None, callback=None, preserve_mtime=False)
where callback can look like:
lambda x,y: print("{} transfered out of {}".format(x,y))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With