LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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, 10:36 AM   #1
sunriver61
LQ Newbie
 
Registered: Jun 2013
Posts: 3

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, 10:45 AM   #2
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
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, 11:17 AM   #3
sunriver61
LQ Newbie
 
Registered: Jun 2013
Posts: 3

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

Rep: Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689Reputation: 3689
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 07:56 PM
[SOLVED] copy files between 2 linux computers sandybeach2000 Linux - Networking 5 11-25-2013 02:50 AM
[SOLVED] copy multiple files to multiple directories Sanderson Linux - Newbie 15 01-22-2013 11:17 AM
Creating a script to move or copy files into multiple directories below the files matthes138 Linux - Newbie 5 08-25-2009 05:57 PM
How do I copy multiple files Leary664 Linux - General 18 09-06-2005 03:58 AM


All times are GMT -5. The time now is 03:48 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration