[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: run scp in background?



On Sat, Jan 26, 2002 at 01:28:54PM -0800, Stonelx wrote:
| Hi,
| I tried this command:
| 
| scp /etc/file remotehost:/etc/file &
| 
| but when scp asks for the password, I'm actually
| back on the command line. (thus the scp command fails)
| Is there anyway around this? I would love
| to be able to run scp in the background.
| I looked at the man page, and see a flag -B ,
| but I don't quite get how that works.
| I basically want to remote shell into my server,
| run a scp command that may take serveral hours, but
| be able to let the scp take place while I exit the shell
| and go for lunch.

Try this :

$ scp <blah> <blah> >/dev/null 2>&1
<enter your password, there will be no prompt>
<press ^Z>
$ bg
$ exit

The idea here is to run the command, but don't give you the usual
output.  You enter your password as usual, but _then_ you background
the process and exit your shell.

(I don't know if this actually will work, but go ahead and find out
:-))

-D

-- 

Stay away from a foolish man,
for you will not find knowledge on his lips.
        Proverbs 14:7



Reply to: