Here's what I need to do:
I need to copy files over the network. The files to be copied is in the one machine and I need to send it to the remote machines. It should be automated and it should be made using python. I am quite familiar with os.popen and subprocess.Popen of python. I could use this to copy the files, BUT, the problem is once I have run the one-liner command (like the one shown below)
scp xxx@localhost:file1.txt yyy@]192.168.104.XXX:file2.txt
it will definitely ask for something like
Are you sure you want to connect (yes/no)?
Password :
And if im not mistaken., once I have sent this command (assuming that I code this in python)
conn.modules.os.popen("scp xxx@localhost:file1.txt yyy@]192.168.104.XXX:file2.txt")
and followed by this command
conn.modules.os.popen("yes")
The output (and I'm quite sure that it would give me errors) would be the different comparing it to the output if I manually type it in in the terminal.
Do you know how to code this in python? Or could you tell me something (a command etc.) that would solve my problem
Note: I am using RPyC to connect to other remote machines and all machines are running on CentOS