Need a script to scp a file to multiple boxes


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need a script to scp a file to multiple boxes
# 1  
Old 07-30-2012
Need a script to scp a file to multiple boxes

Hello All,

I am new to scripting and I am trying to write a script which can scp a file from one box to multiple boxes.
I am thinking to do like this.
1) create a file with list of all server names
2)write a script which will pick up each server line by line from server list and copy it to required dir

say I have my server list here cat /home/test/server.lst

171.134.55.23
171.133.23.24
and so on


scp sample user@host:

host should be replaced by each server at a time and copy it to required path.

Please help me.Thanks in advance
# 2  
Old 07-30-2012
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script to login into multiple linux boxes

I have requirement to login into a multiple linux boxes by running the shell script in a single linux box and to find the count of files in a specific folder in each box and log them in a log file in the box where i m runnning the script. Box names will be stored in a text file host.txt. Please... (2 Replies)
Discussion started by: Mani2512
2 Replies

2. Shell Programming and Scripting

scp command for multiple file transfer.

FILE_LIST="{a.txt,b.txt,cal*}" scp -r $..$REMOTE_PATH$FILE_LIST $LOCAL_PATH This script passes only when all the three files are transfere, wat if only two file are transfered, but still I was to make the return code as pass. is it possible. (2 Replies)
Discussion started by: sangea
2 Replies

3. Shell Programming and Scripting

How to run the multiple scp from single script?

Dear Experts, how to run multiple scp commands from single scripts. In a directory oracle redo files accumulate. i would like to copy those redo logs to my standby server. For same i am using scp to copy the files. where i am monitoring that as it is sending the files sequentially most of... (1 Reply)
Discussion started by: nmadhuhb
1 Replies

4. Shell Programming and Scripting

Script to SCP a file to multiple servers

Hi All, I am a total noob to the Unix world, and i hope to learn a lot from this wonderful community. Here's my first post and question , i am trying to SCP a file to multiple servers (multiple destinations) through this little script : #!/bin/ksh # copy files # File to be copied... (7 Replies)
Discussion started by: rdlover
7 Replies

5. Shell Programming and Scripting

Automated ssh to multiple boxes

I have a script that will ssh to several different servers, perform a command, display the output, and exit. It works well, but I have to enter my password for each server. That gets a little cumbersome when you have a couple dozen servers. Anyone out there know how to automate this so that I only... (2 Replies)
Discussion started by: fedexer
2 Replies

6. UNIX for Dummies Questions & Answers

Virtualbox OSE on multiple boxes

I have Virtualbox OSE installed on my laptop and soon on my lap top. My question is if I were to make a virtual os on an external hard drive on my laptop, can i make a settings to use the same vdi on my desktop and have it show the same screen, not at the same time. sorry, its late here and I... (0 Replies)
Discussion started by: Texasone
0 Replies

7. Shell Programming and Scripting

I need a Script to rsh multiple hp boxes and shutdown

Hello I'm serving on a ship that has frequent power issues. Currently if we loose power we need to rush around to multiple UNIX machines and login to Sysadmin and power down each machine before we loose our ups. If sysadmin is asleep or not in the space we have some real problems. I would like to... (2 Replies)
Discussion started by: blackfam972
2 Replies

8. UNIX for Dummies Questions & Answers

Getting one script to run on multiple boxes

I have a script that generates an output file after pulling data from a local DB on one of my boxes. There are other nearly-identical boxes on the network, each with their own local DB, and I'd like to run the script there too. Copying the script to each box and then running them individually... (11 Replies)
Discussion started by: bschnair
11 Replies

9. Programming

text boxes, radio buttons , check boxes in c++ on unix

Hi ! Please tell me how to get radio buttons, text boxes , check boxes , option buttons , pull down menus in C++ on Unix. I think it would be done using curses.h ..but that's all i know. TIA, Devyani. (3 Replies)
Discussion started by: devy8
3 Replies
Login or Register to Ask a Question