Monitoring background Jobs on UNIX systems | dbazone

Monitoring background Jobs on UNIX systems

Posted on February 6th, 2010 in Oracle on Linux ,

To monitor background jobs on UNIX, you can use the following commands :

  • jobs
  • ps

jobs command

jobs command will list all the jobs running in the background as follows:
[1]  – 12427 Running              test.pl
[2]  + 12540 Stopped            myprog.pl

The value within “[]” is the job number. By this number you can control our jobs, like you can kill job or  bring the job to foreground.

ps command

ps    command will display a list of processes as follows

PID TTY      TIME CMD
12427  pts/10   1:07  test.pl

Where

  • PID – Process identification number. By this number you can kill the process.
  • TTY- terminal name where the process is executing
  • TIME – time elapsed
  • CMS- the process name, your script or program name

Bringing Job to the Foreground

Please remember, a background job may be brought to the foreground if it was initiated during the current login session. Jobs which were initiated during other login sessions and which are still running cannot be brought to the foreground. However, it is possible to send signals to such jobs using the “kill” command. A background job or a stopped job may be brought to the foreground with ” fg” command.

fg  %1 , 1 is the job number

Terminating Background Jobs

Jobs from the current session can usually be terminated by bringing them to the foreground and interrupting them with control-c key.

Another way for terminating jobs running under your user id  with  “kill” command.

Different way to terminate a job

By job id number as follows :

kill -9 %1

By Process Id (PID) as follows :

kill -9 PID

Please remember with kill you can not only terminate jobs for current session, you can terminate jobs initiated by other user login session also.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter

Related posts:

  1. Controling jobs on UNIX systems UNIX  job monitoring and control facilities allows you to monitor...
  2. Background jobs on Unix impact on System Performance Is your background jobs on Unix impact on System Performance?...
  3. Kill Oracle process from UNIX server In some scenarios , my database may be hung and...
  4. Killing Oracle Sessions There are different ways to kill oracle sessions From  SQL*PLUS...
  5. Useful UNIX command for oracle dba 1).To find the top 10 larger files in the Directory...

Related posts brought to you by Yet Another Related Posts Plugin.

Published by Paresh Sarma

Leave a Comment

Follow dbazonein on Twitter
Increase Google Page Rank