LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-05-2015, 09:36 AM   #1
sunriver61
LQ Newbie
 
Registered: Jun 2013
Posts: 6

Rep: Reputation: Disabled
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!
 
Old 04-05-2015, 09:45 AM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
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.
 
1 members found this post helpful.
Old 04-05-2015, 10:17 AM   #3
sunriver61
LQ Newbie
 
Registered: Jun 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Wouldn't you need to put in a password for each remote computer?
 
Old 04-05-2015, 10:31 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by sunriver61 View Post
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] copy or transfer files between 2 Linux computers why_so_serious Linux - Newbie 15 02-14-2014 06:56 PM
[SOLVED] copy files between 2 linux computers sandybeach2000 Linux - Networking 5 11-25-2013 01:50 AM
[SOLVED] copy multiple files to multiple directories Sanderson Linux - Newbie 15 01-22-2013 10:17 AM
Creating a script to move or copy files into multiple directories below the files matthes138 Linux - Newbie 5 08-25-2009 04:57 PM
How do I copy multiple files Leary664 Linux - General 18 09-06-2005 02:58 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration