LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   SCP as a background process (https://www.linuxquestions.org/questions/linux-general-1/scp-as-a-background-process-515164/)

Edmunds 12-31-2006 11:06 AM

SCP as a background process
 
I need to transfer 420GBs of files from one machine to another. I don't have physical access to either, so I'm using Putty to get this done from a windows box. The command I'm doing it with is

Code:

scp -r dir root@xxx.xxx.xxx.xxx:/home2/
But if I close the putty window (as I obviously can't be bothered to keep it on whilst 420GBs transfer as that's gonna take a few days), the transfer stops.

I tried to run it as a background process (adding an &), but it just won't do that, as it's requesting a password. I tried to run it without requesting a password (with -B), but then it just spits out "permission denied".

Any help?

tredegar 12-31-2006 11:22 AM

I think screen is what you need.
man screen, or search this site for how to put process into the background ("detached") with this useful utility.
Hope this helps.
Edit: Here's a link to how to use screen:
http://www.rackaid.com/resources/tips/linux-screen.cfm

... & welcome to LQ!

namit 12-31-2006 11:29 AM

try a & at the end of that and it should set it up as a process. or is there a verbose option on scp or debug you could use.

billybadfoot 12-31-2006 11:38 AM

You can achieve this by setting up keyed access rather than password access, but making sure that you create a key which doesn't need a pass-phrase. You would install one part of the key on the remote machine and supply the location of the second part of the key to the scp command. As it doesn't require any further passwords, it can be run unattended, for instance as a background job or as a cron/scheduled job.

raskin 12-31-2006 12:20 PM

Try - after entering password - pressing Ctrl-Z and then running 'bg' and 'disown' before logging out.


All times are GMT -5. The time now is 11:15 PM.