jobs

jobs

am 27.09.2007 16:39:57 von bobfob

Hi,

I logged into my VMWare ESX 2.51 server and set a job going as a
background job by appending a &
If I type jobs it lists the job.

(Below is just an example - the real script I use writes a logfile.)

[root@lon-esx1 root]# find / -name nick &
[1] 4690
/var/spool/mail/nick
[root@lon-esx1 root]# jobs
[1]+ Running find / -name nick &
[root@lon-esx1 root]#

If I log out and log back in again and type jobs, it's disappeared
from the list although I know it's still runnning because the script
outputs a log file which if I tail -f logfile.txt I can see it's still
running.

[root@lon-esx1 root]# jobs
[root@lon-esx1 root]#

I'm sure I'm not understanding how jobs works correctly - but am
hoping someone can enlighten me.
How can I logoff, logon again and see the jobs list?

ESX doesn't provide the 'screen' utility as far as I can see.

Cheers,

Nick.

Re: jobs

am 27.09.2007 16:56:08 von Icarus Sparry

On Thu, 27 Sep 2007 14:39:57 +0000, Nick Allen wrote:

> Hi,
>
> I logged into my VMWare ESX 2.51 server and set a job going as a
> background job by appending a &
> If I type jobs it lists the job.
>
> (Below is just an example - the real script I use writes a logfile.)
>
> [root@lon-esx1 root]# find / -name nick & [1] 4690
> /var/spool/mail/nick
> [root@lon-esx1 root]# jobs
> [1]+ Running find / -name nick & [root@lon-esx1 root]#
>
> If I log out and log back in again and type jobs, it's disappeared from
> the list although I know it's still runnning because the script outputs
> a log file which if I tail -f logfile.txt I can see it's still running.
>
> [root@lon-esx1 root]# jobs
> [root@lon-esx1 root]#
>
> I'm sure I'm not understanding how jobs works correctly - but am hoping
> someone can enlighten me.
> How can I logoff, logon again and see the jobs list?
>
> ESX doesn't provide the 'screen' utility as far as I can see.
>
> Cheers,
>
> Nick.

The "jobs" command tells you the immediate children of the current shell.
When you log out and log back in you have a different process running the
shell, so you do not see it. You can get the same effect by typing "csh"
or "bash" or "ksh" or whatever you shell is and then running "jobs", the
output will be empty. if you then use "exit" to leave the new shell, and
go back to your old shell then "jobs" will again output the current
children.

The normal way to see what is running is the "ps" command, which may
stand for "process status".

Re: jobs

am 27.09.2007 17:01:28 von gerg

Nick Allen writes:
>
>
>If I log out and log back in again and type jobs, it's disappeared
>

What has happened is that your background process has lost its
connection with its parent process (your shell) when you logged out.

When you log back in, no connection is made to your new shell process,
so your new shell doesn't know about the background process and can't
display it to you.

Many people use a utility named "screen" for detaching from their
background processes and re-attaching to them. Screen does a lot
of other things, so it's a bit of a complex program to learn.

-Greg
--
::::::::::::: Greg Andrews ::::: gerg@panix.com :::::::::::::
I have a map of the United States that's actual size.
-- Steven Wright

Re: jobs

am 27.09.2007 17:42:21 von bobfob

On Sep 27, 3:56 pm, Icarus Sparry wrote:
> On Thu, 27 Sep 2007 14:39:57 +0000, Nick Allen wrote:
> > Hi,
>
> > I logged into my VMWare ESX 2.51 server and set a job going as a
> > background job by appending a &
> > If I type jobs it lists the job.
>
> > (Below is just an example - the real script I use writes a logfile.)
>
> > [root@lon-esx1 root]# find / -name nick & [1] 4690
> > /var/spool/mail/nick
> > [root@lon-esx1 root]# jobs
> > [1]+ Running find / -name nick & [root@lon-esx1 root]#
>
> > If I log out and log back in again and type jobs, it's disappeared from
> > the list although I know it's still runnning because the script outputs
> > a log file which if I tail -f logfile.txt I can see it's still running.
>
> > [root@lon-esx1 root]# jobs
> > [root@lon-esx1 root]#
>
> > I'm sure I'm not understanding how jobs works correctly - but am hoping
> > someone can enlighten me.
> > How can I logoff, logon again and see the jobs list?
>
> > ESX doesn't provide the 'screen' utility as far as I can see.
>
> > Cheers,
>
> > Nick.
>
> The "jobs" command tells you the immediate children of the current shell.
> When you log out and log back in you have a different process running the
> shell, so you do not see it. You can get the same effect by typing "csh"
> or "bash" or "ksh" or whatever you shell is and then running "jobs", the
> output will be empty. if you then use "exit" to leave the new shell, and
> go back to your old shell then "jobs" will again output the current
> children.
>
> The normal way to see what is running is the "ps" command, which may
> stand for "process status".

Hi Icarus,

Thanks for the explanation. Much appreciated.
Don't fly too close to the sun.

Cheers,

Nick.