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

Re: list of all background jobs



Hello Kamaraju,

Am 2008-05-28 17:52:43, schrieb Kamaraju S Kusumanchi:
> Consider the following scenario. I am on machine A.
> 
> user1@machineA $ ssh user2@machineB
> user2@machineB $ nohup command1 &
> user2@machineB $ nohup command2 &
<snip>
> After some time (say after a day or so) I log back in to machineB.
> 
> user1@machineB $ ssh user2@machineB
> user2@machineB $ jobs
> 
> then there is no output even though the jobs are being run in the
> background. 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
> 
> user2@machineB $ ps aex | grep nohup | gvim -
> 
> Is there any better, more elegant solution for this problem?

No, since jobcontrol does only work in the currently running shell.

If you need to have the process running even if you close your shell,
use following to detach the process:

    user1@machineA $ ssh user2@machineB
    user2@machineB $ command1 &
    user2@machineB $ disown
    user2@machineB $ command2 &
    user2@machineB $ disown

which let the process running without terminating it but you  will  lost
the job control.

I personaly run my own job control program/script which whatch jobs even
if they are detached...

Thanks, Greetings and nice Day
    Michelle Konzack
    Systemadministrator
    24V Electronic Engineer
    Tamay Dogan Network
    Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack   Apt. 917                  ICQ #328449886
+49/177/9351947    50, rue de Soultz         MSN LinuxMichi
+33/6/61925193     67100 Strasbourg/France   IRC #Debian (irc.icq.com)

Attachment: signature.pgp
Description: Digital signature


Reply to: