I'm using Paramiko's SFTPClient to transfer file between hosts. I want my script to print the file transfer progress similar to the output seen using scp.
$ scp my_file user@host
user@host password:
my_file 100% 816KB 815.8KB/s 00:00
$
Any idea?
Thanks in advance
Use the optional callback parameter of the put function. Something like this:
def printTotals(transferred, toBeTransferred):
print "Transferred: {0}\tOut of: {1}".format(transferred, toBeTransferred)
sftp.put("myfile","myRemoteFile",callback=printTotals)