LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-28-2007, 07:06 PM   #1
Moonman
Member
 
Registered: May 2004
Posts: 37

Rep: Reputation: 15
Make SCP run in background?


Does anyone know how to kick off an SCP file copy and make it run in the background so it will continue to run after disconnecting the session?

I have tried various combinations of using nohup and the & but the password prompt is what is preventing me from getting it to work.

ie. nohup scp filename user@host: &

The process gets hung up in the background because it is waiting for a password to be entered.

Thanks,
 
Old 11-28-2007, 09:32 PM   #2
FragInHell
Member
 
Registered: Sep 2003
Location: Sydney Australia
Distribution: Redhat, Centos, Solaris, Ubuntu, SUSE
Posts: 282

Rep: Reputation: 45
Hello,


You could setup SSH keys for this, then you will be able to ssh or scp without a password from one server to another. Make sure you can run it interactively before running though nohup to test it works ok. Also as an alternative to nohup you could schedule the job using cron or use screen to run an interative session.
 
Old 11-29-2007, 07:32 AM   #3
farslayer
LQ Guru
 
Registered: Oct 2005
Location: Northeast Ohio
Distribution: linuxdebian
Posts: 7,249
Blog Entries: 5

Rep: Reputation: 191Reputation: 191
Screen is probably your best bet.

Quote:
The other main cool feature of screen is its ability to decouple the terminal emulator from the running programs. This means that you can use screen to keep programs running after you accidentally close the terminal emulator, or even after you log out, and later resume right where you were. It means that the idea of a "session" in which you are running a number of console programs is a free-floating entity that you can bind to any terminal anywhere, or no terminal at all if you want.
 
Old 11-29-2007, 07:46 AM   #4
cornish
Member
 
Registered: May 2005
Location: Sussex, England
Distribution: Ubuntu 7.10
Posts: 131

Rep: Reputation: 15
I will agree with farslayer you should really look into screen, I use it a work to kick of some scripts and then check on the progress from home sometimes

Last edited by cornish; 11-29-2007 at 07:47 AM.
 
  


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
rtorrent. how to make it run in the background?? nass Linux - Software 6 01-25-2022 01:29 AM
run c function in the background schneidz Programming 4 09-07-2007 07:29 AM
SCP as a background process Edmunds Linux - General 4 12-31-2006 12:20 PM
Is it possible to make scp Continue/Resume after an interruption? lothario Linux - Software 5 06-03-2006 11:40 PM
how to run any binary in background - background process tej Linux - Newbie 1 08-16-2004 12:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:29 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