Jul-14-2021, 04:58 AM
Greetings to those that do not sleep!
I have a bunch of remote hosts(windows), each host has a windows based system connected to it (I call it a Station).
I need to copy files from each Station to my server.
I made a little script and I can copy it to all hosts but the big question is how I can call/ran the script from my server?
script
Thank you.

I have a bunch of remote hosts(windows), each host has a windows based system connected to it (I call it a Station).
I need to copy files from each Station to my server.
I made a little script and I can copy it to all hosts but the big question is how I can call/ran the script from my server?
script
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
from pathlib import Path import shutil l_dst = "c:\\02" ip_tm = "DESK-2" r_src = "\\\\"+itm+" \\c$\\ 01 " for eitem in Path(r_src).iterdir() : print ( f " Item {eitem}" ) if eitem.is_file() : print ( f " It is file {eitem}" ) try : shutil.copy(eitem,l_dst) except OSError as rr : print ( f " Cannot Copy File {rr}" ) |