How to get percentage output from simple scp script on Windows 10

Viewed 19

I am going crazy trying to figure out how to get output from a simple scp command in Python on a Windows 10 device. I am writing a script that transfers a file from my local Windows laptop to a Linux based "jump server". From there I want to transfer the files from the jump server to the rest of my devices in my network. I have everything working with the exception of getting a percent complete when transferring from my Windows laptop to the jump server. Is there a strange way that Windows displays scp completion percentage? I have tried Google'ing everything that I can think of looking for an answer. This is what I am trying right now (I have tried so many different methods):

command = "scp -i c:<path-to-ssh-key> c:<path-to-file> <user@host>:<remote-filepath>"

proc = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) 
proc.wait() 
print 'result: %s' % repr(proc.stderr.readline())

If there is a better answer than scp, I am all ears.

Please help so I can stop crying these tears of frustration and go on with my life happily.

0 Answers
Related