Problem with SCP parellel processing


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Problem with SCP parellel processing
# 1  
Old 11-04-2008
Problem with SCP parellel processing

Hi All,

I am trying to take Bulk Log files from around 24 Remote servers using my shell script. I am using SCP for this. I need to take log files every 15 min, so I am thinking about the parallel processing mechanism in UNIX.The 24 remote machines username,servername reading from properties file. My code will look like this :

while read list
do
----
nohup scp $FRONTEND_USER@$FRONTEND_SERVER:/REMOTEDIR/LOG_FILENAME.* . &
----
done < listdatafile.properties
wait // wait command is using for all the 24 background process to finish before doing the next part of the script


The problem now i am facing is it is doing the first SCP and prompting for enter key to come out from SCP command..I can't press enter key every time because this process is a cronjob. Can anybody help me from this problem ? Any suggestions in the existing part also most welcome.

Thanks and Regards,
Scorpio
# 2  
Old 11-04-2008
Strange it's waiting for "Enter". You can ssh/scp without entering a passphrase right? You also created the keys without entering a passphrase, right?
Maybe try it out with "-B" or one of the ssh options "-o ....".

If nothing of that works, maybe setup up a central rsync server as alternative which can handle parallel transfers. You can define in the rsyncd.conf how many parallel connections are allowed.
# 3  
Old 11-04-2008
Hi ,

" You also created the keys without entering a passphrase, right? "
sorry Smilie
I didn't understand your question ?

While doing the SCP ommand without & , it will not prompt for enter key to press. But that time the process will not run in background also..

Is it possible to give the enter key as a input parameter ? if yes how i can do that ?

Thanks and Regards,
Scorpio
# 4  
Old 11-04-2008
When you create ssh keys for ssh or scp connections with ssh-keygen, you will be asked to enter a passphrase. For batch jobs/scripts you will not enter anything there but just press enter so you will not be asked everytime doing ssh/scp for a passphrase to enter.

Usually you don't have to press enter, even when using scp in a script via cron. So I recommended trying out inserting -B or -o with an approriate ssh option. Did you try out -B for example?
# 5  
Old 11-04-2008
YEs , I tried nohup scp -B $FRONTEND_USER@$FRONTEND_SERVER:/REMOTEDIR/LOG_FILENAME.* . &

it is still prompting for enter key to press
# 6  
Old 11-04-2008
Sorry, I can't reproduce the problem - it's working in my environment. If no one else gives a hint, maybe move to rsync.
# 7  
Old 11-04-2008
You also should look into PDSH. There's a module to enable a command (pdcp) to work in parallel, where you specify the number of parallel operations. It will use rcp or scp, as you wish.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

Scp, problem, .bashrc

I have a problem with SCP, trying to use this solution in .bashrc: scp printed an error message: "Write failed flushing stdout buffer. write stdout: Broken pipe." or "packet too long". Your shell startup file (e.g., ~/.cshrc, ~/.bashrc), which is run when scp connects, might be writing a... (3 Replies)
Discussion started by: orange47
3 Replies

2. Shell Programming and Scripting

parellel execution of a sub script in mutilple hosts

Hi, I have a main script which will login to different machines one by one and execute the another script as input which will execute some commands after login to the machine. i used while loop and it executes it like ssh to a machine and running the sub script, then moving to the second... (1 Reply)
Discussion started by: rbalaj16
1 Replies

3. UNIX for Dummies Questions & Answers

Problem with SCP command

hi, I am successfully running following command from command prompt $ scp oracle@172.16.0.11:/back/crmemo.csv /sales/ but when i am running the same command from a script it copying '?' in sales (destination) folder. Following is the script #!/bin/sh scp... (14 Replies)
Discussion started by: RIAZ
14 Replies

4. UNIX for Advanced & Expert Users

Problem with ssh and scp

Hi there, I'm working with two linux servers and if I use ssh to connect from 1 to 2 everything works fine ( ..as usual:rolleyes:), while if I try to connect via ssh or to copy files through scp (as I usually do...) from 2 to 1, after the password I get this message: Connection closed by... (6 Replies)
Discussion started by: Giordano Bruno
6 Replies

5. Shell Programming and Scripting

Help in running two processes in parellel

I have a script something like this: #!/usr/bin/ksh CLASSPATH=/apps/opt/db2udb/admin/db2bdt/sqllib/java/db2java.zip:/apps/opt/db2udb/admin/db2bdt/sqllib/java/db2jcc.jar:/apps/opt/db2udb/admin/db2bdt/sqllib/function:$CLASSPATH export CLASSPATH ... (7 Replies)
Discussion started by: ss3944
7 Replies

6. SCO

adding a add on parellel port on S3000 chipset

Our new server is a HCL INFINITY GLOBAL LINE 1700AH ,intel xeon S3000 chipset.It has no onboard parellel port.The vendor is suggesting printing solution through serial port ,but ours is mostly printing work. I would like to know weather an addon parellel port can be added without conflict. OS is... (3 Replies)
Discussion started by: vikramviky
3 Replies

7. UNIX for Advanced & Expert Users

scp problem

I have some problems using scp between a server Sun Solaris and a SecurePlatform Checkpoint. If I try to copy a simple file txt from the server Sun Solaris to the SecurePlatform, I have problems!!!!!!... server:/export/home/appmgt# scp 1.txt admin2@fwtest:~ lost connection ... if I try to... (5 Replies)
Discussion started by: Minguccio75
5 Replies

8. UNIX for Dummies Questions & Answers

problem with SCP

Hi, I want to copy a file from one system to other i done a SCP but it showing error as below .. Can we do it by SCP ? Is it possible ?.. What is the below mean ?. sys1@sys2's password: scp: .: not a regular file Thanks, Arun (4 Replies)
Discussion started by: arunkumar_mca
4 Replies

9. UNIX for Advanced & Expert Users

scp problem

Hi, I have problem using scp in an AIX machine, where I need to use full path to scp from /dirA but i dont have to from /dirB of the same machine. Below are some details & scp -v output (truncated). I've checked the permission & settings of both dir/FS are the same. Please help. scenario scp... (2 Replies)
Discussion started by: juliehussin
2 Replies

10. UNIX for Advanced & Expert Users

scp problem

I am using scp to get files from a Windows systemr to a Unix system. The ssh server is on Windows. The problem is that the file permissions for files that come from Windows are 700. Can any one help out with how I can set permissions to anything else? (6 Replies)
Discussion started by: blowtorch
6 Replies
Login or Register to Ask a Question