Kamaraju S Kusumanchi wrote:
Consider the following scenario. I am on machine A.

[EMAIL PROTECTED] $ ssh [EMAIL PROTECTED]
[EMAIL PROTECTED] $ nohup command1 &
[EMAIL PROTECTED] $ nohup command2 &

Now if I use the jobs command, I can display the background jobs on this
shell.

[EMAIL PROTECTED] $ jobs

[1] Running  nohup command1 &
[2] Running  nohup command2 &

Now if I exit the shell on machineB and come back to machineA.

[EMAIL PROTECTED] $ exit
[EMAIL PROTECTED] $

After some time (say after a day or so) I log back in to machineB.

[EMAIL PROTECTED] $ ssh [EMAIL PROTECTED]
[EMAIL PROTECTED] $ jobs

then there is no output even though the jobs are being run in the
background.

That is to be expected, since `jobs' is a shell builtin and lists backgrounded jobs running in that shell alone.

Is there any way to get information about all the jobs being
run in the background that belong to a particular user? In other words is
there any way to display information about [1],[2] jobs in the new shell?

Currently I am using a round about way to achieve this

[EMAIL PROTECTED] $ ps aex | grep nohup | gvim -

Is there any better, more elegant solution for this problem?

I use `pgrep nohup' to find processes containing 'nohup' in the command, or `ps x -u <username>' to find processes belonging to a certain user.


thanks
raju


--

If you can't explain it simply, you don't understand it well enough.
                                       -- Albert Einstein


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to