LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Copy 2 files to multiple computers (https://www.linuxquestions.org/questions/linux-newbie-8/copy-2-files-to-multiple-computers-4175538812/)

sunriver61 04-05-2015 09:36 AM

Copy 2 files to multiple computers
 
Does anyone know a way to copy two files to multiple computers? I'm thinking of scp as the flavor of linux we're using does not include rdist.

I've read that scp can't copy multiple files, however maybe some scripting genius has figured out a way. Running two scripts (one for each file), is perfectly ok!

If anyone care to post very clear examples (i'm definitely not a programmer...) of scripts, etc, that would be great.

Thanks in advance to all those who can help!

suicidaleggroll 04-05-2015 09:45 AM

Why can't scp copy multiple files?
Code:

scp file1 file2 user@IP:/path/to/dest/
Which part of this script are you having issues with? How are your computer names stored? What do you expect this script to look like or operate? Just sticking the above line in a loop over various IPs should get you there in < 5 lines of code.

sunriver61 04-05-2015 10:17 AM

Wouldn't you need to put in a password for each remote computer?

TB0ne 04-05-2015 10:31 AM

Quote:

Originally Posted by sunriver61 (Post 5342890)
Wouldn't you need to put in a password for each remote computer?

That's a "maybe" answer.

Yes, you would..unless you did a keyswap between the machines. In which case, no you wouldn't. A decent example with sample script is here:
http://www.linuxjournal.com/article/8600

If you don't do keyswaps (something that will make a LOT of things easier in the future), you can always use expect to do this...and enjoy having user names/passwords hard-coded in a file for everyone to see.


All times are GMT -5. The time now is 12:09 AM.