LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 07-24-2007, 09:17 PM   #1
ufmale
Member
 
Registered: Feb 2007
Posts: 385

Rep: Reputation: 30
start new terminal windows to run a new program


I would like to run mulitple “scp” over the network at the same times.
There are 100 directories. and I would like each one to process simultaneously so that it finish quicker.
How do I do that from Redhat Enterprise 4? Is there a way to create new process in different terminal automatically.

scp -rv /home/joe/1a/* max@com1:/mnt/max/1a/
scp -rv /home/joe/1b/* max@com1:/mnt/max/1b/
...
...
...

Last edited by ufmale; 07-24-2007 at 09:25 PM.
 
Old 07-24-2007, 09:42 PM   #2
thloh85
Member
 
Registered: Apr 2006
Location: Earth
Distribution: BLFS customized
Posts: 160

Rep: Reputation: 31
add a & between all commands... thats the easiest way...

scp -rv /home/joe/1a/* max@com1:/mnt/max/1a/ &
scp -rv /home/joe/1b/* max@com1:/mnt/max/1b/ &
... &
... &

---
edit : That does NOT spawn new windows, but rather new processes...

Last edited by thloh85; 07-24-2007 at 09:43 PM.
 
Old 07-24-2007, 11:24 PM   #3
ufmale
Member
 
Registered: Feb 2007
Posts: 385

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by ghostdev85
add a & between all commands... thats the easiest way...

scp -rv /home/joe/1a/* max@com1:/mnt/max/1a/ &
scp -rv /home/joe/1b/* max@com1:/mnt/max/1b/ &
... &
... &

---
edit : That does NOT spawn new windows, but rather new processes...

I tried. That would not work because scp requires the password input.
Therefore, I need some way to spawn a new window, and I can enter passwd manually to each window. Is there anyone have a solution to this?
 
Old 07-25-2007, 01:45 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,357

Rep: Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367Reputation: 2367
Use authorised keys so you don't have to keep inputting the passwd.
Also, use 'nohup', so you can close the window/logout if needed ie

nohup scp -rv /home/joe/1a/* max@com1:/mnt/max/1a/ &
.
.
.
 
Old 07-25-2007, 08:41 AM   #5
ufmale
Member
 
Registered: Feb 2007
Posts: 385

Original Poster
Rep: Reputation: 30
Quote:
Originally Posted by chrism01
Use authorised keys so you don't have to keep inputting the passwd.
Also, use 'nohup', so you can close the window/logout if needed ie

nohup scp -rv /home/joe/1a/* max@com1:/mnt/max/1a/ &
.
.
.
I did search on the internet and see how to implement the pubkey. However, I don't have to all the dir on the target machine. or it is not possible to put the public key there. Do you have other suggestion?
 
Old 07-25-2007, 09:11 AM   #6
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,232
Blog Entries: 5

Rep: Reputation: 190Reputation: 190
It looks like you are synchronizing a bunch of directories between two locations. did you consider using rsync instead of scp ? since rsync would only be copying data that has changed it may speed up the process considerably..
 
  


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
can i run a php program to connect to mysql db 4.0 in terminal supritipanda Programming 4 08-11-2006 11:11 AM
how do you run a program from terminal? fatbeaver Linux - Newbie 1 04-26-2006 12:41 PM
any way to continue using the terminal while any program is being run? g_srinivas Linux - Newbie 6 07-20-2005 08:30 AM
How to start a program in terminal and let it 'detach' neo_in_matrix Linux - Newbie 2 04-12-2005 05:08 AM
How to run a program on another terminal SharpyWarpy Linux - General 2 02-10-2005 02:09 PM


All times are GMT -5. The time now is 11:10 AM.

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