Monitoring background Jobs on UNIX systems
Posted on February 6th, 2010 in Oracle on Linux monitor background jobs on UNIX, UNIX commands
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.
Related posts:
- Controling jobs on UNIX systems UNIX job monitoring and control facilities allows you to monitor...
- Background jobs on Unix impact on System Performance Is your background jobs on Unix impact on System Performance?...
- Kill Oracle process from UNIX server In some scenarios , my database may be hung and...
- Killing Oracle Sessions There are different ways to kill oracle sessions From SQL*PLUS...
- 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.















Leave a Comment