I am using a tool which will create files in remote windows 2012 servers continuously. I need to get those files and place it in a local directory.
import os
import time
def copy_logs():
os.system(".\pscp.exe -pw test123 C:/Users/Administrator/Desktop/tr* Administrator@1.1.1.1:/")
time.sleep(7200)
while True:
copy_logs()
I have used 'pscp' inside python script to copy files. But I am unable to specify space/destination directory to copy the files into.
Is there anyway to achieve this with Python?