someone please help!
im currently writting a python script to actually retrieve a file size that is in a local PC and a remote server. then, what i do is, i compare if the file's size are the same. below is my code :
A = "/path/of/the/file/in/my/local/PC"
B = "/path/of/the/file/in/remote/PC"
statinfo1 = os.stat(A)
statinfo2 = os.system ("ssh" " root@192.168.10.1" " stat -c%s "+B)
if statinfo1 == statinfo2 :
print 'awesome'
else :
break
problem encountered : statinfo1 is able to return the file size in the local PC, but statinfo2 is not able to return the file size.. anyone please help? i want to use SSH method
ssh
have password? If it does the above would not work.%s
but then you use+
; its not doing what you think its doing.%s
is not meant for Python, but for thestat
command (it means "show the total size in bytes")" "
in the string doesn't give me much confidence :)stat -c%s
on the local file aswell..