Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Debian User (http://www.linux-archive.org/debian-user/)
-   -   list of all background jobs (http://www.linux-archive.org/debian-user/97129-list-all-background-jobs.html)

John Hasler 05-28-2008 10:26 PM

list of all background jobs
 
raju writes:
> Is there any better, more elegant solution for this problem?

toncho/~ apt-cache show screen
Package: screen
Priority: optional
Section: misc
Installed-Size: 896
Maintainer: Jan Christoph Nordholz <hesso@pool.math.tu-berlin.de>
Architecture: i386
Version: 4.0.3-9
Depends: libc6 (>= 2.7-1), libncursesw5 (>= 5.6+20071006-3), libpam0g (>= 0.99.7.1)
Filename: pool/main/s/screen/screen_4.0.3-9_i386.deb
Size: 589362
MD5sum: 3fa012dca204c4f598cc86fb54422fdf
SHA1: b7f544e36e4dca79c269d04539e614636f96f2d4
SHA256: 9638298c9b275fad7696d39564246966a9026bbaa8969a45f0 570a2cb76c825a
Description: terminal multiplexor with VT100/ANSI terminal emulation
screen is a terminal multiplexor that runs several separate "screens" on a
single physical character-based terminal. Each virtual terminal emulates a
DEC VT100 plus several ANSI X3.64 and ISO 2022 functions. Screen sessions
can be detached and resumed later on a different terminal.
.
Screen also supports a whole slew of other features. Some of these are:
configurable input and output translation, serial port support, configurable
logging, multi-user support, and utf8 charset support.
Tag: implemented-in::c, interface::text-mode, role::program, scope::utility, uitoolkit::ncurses, works-with::software:running

--
John Hasler


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Raj Kiran Grandhi 05-29-2008 12:44 AM

list of all background jobs
 
Kamaraju S Kusumanchi wrote:

Consider the following scenario. I am on machine A.

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

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

user2@machineB $ jobs

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

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

user2@machineB $ exit
user1@machineA $

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.


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

user2@machineB $ 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 debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Michelle Konzack 05-29-2008 12:00 PM

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)


All times are GMT. The time now is 07:55 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.