|
Home > Archive > Unix Shell > February 2007 > Background jobs from ssh
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Background jobs from ssh
|
|
| jhavero@gmail.com 2007-02-16, 1:17 pm |
| I have a start.sh on Linux that starts a bunch of jobs in background
mode:
#!/bin/sh
# script: start.sh
job1 &
job2 &
I'm able run start.sh using plink (Putty's Windows ssh client):
C:\>plink user@hostname -pw password "/home/user/start.sh"
However, my plink command won't return until the background jobs have
finished. I don't want my
ssh client to have to wait. Is there any way around this?
| |
| Bill Marcum 2007-02-16, 7:16 pm |
| On 16 Feb 2007 10:40:54 -0800, jhavero@gmail.com
<jhavero@gmail.com> wrote:
>
>
> I have a start.sh on Linux that starts a bunch of jobs in background
> mode:
>
> #!/bin/sh
> # script: start.sh
> job1 &
> job2 &
>
> I'm able run start.sh using plink (Putty's Windows ssh client):
>
> C:\>plink user@hostname -pw password "/home/user/start.sh"
>
> However, my plink command won't return until the background jobs have
> finished. I don't want my
> ssh client to have to wait. Is there any way around this?
>
Make sure standard input, output and error are closed or redirected.
The second line of your script could be:
exec <&- >logfile 2>&1
--
interest, n.:
What borrowers pay, lenders receive, stockholders own, and
burned out employees must feign.
| |
| gimme_this_gimme_that@yahoo.com 2007-02-17, 7:15 pm |
| Try putting "nohup" before job1 and job2.
nohup means "no-hang-up" which means you should be able to exit ssh
and have the jobs continue to run.
| |
| Bit Twister 2007-02-17, 7:15 pm |
| On 17 Feb 2007 15:20:30 -0800, gimme_this_gimme_that@yahoo.com wrote:
> Try putting "nohup" before job1 and job2.
>
> nohup means "no-hang-up" which means you should be able to exit ssh
> and have the jobs continue to run.
nohup will not solve the problem. Redirection is the solution.
jobx > /dev/null 2>&1 &
|
|
|
|
|