tags:

views:

544

answers:

3

i have created a job with at command on solaris 10 it's working now but i want to kill it but i dont know how can i find job number and how to kill that job or process

any help ?

+1  A: 

Hi there,

To delete a job which has not yet run you need the "atrm" command. You can use "atq" command to get it's number in the at list.

To kill a job which has already started to run, you'll need to grep for it using:

ps -eaf | grep <command name>

and then use "kill" to stop it.

A quicker way to do this on most systems is:

pkill <command name>
Benj
A: 

You should be able to find your command with a ps variant like:

ps -ef
ps -fubob # if your job's user ID is bob.

Then, once located, it should be a simple matter to use kill to kill the process (permissions permitting).

If you're talking about getting rid of jobs in the at queue (that aren't running yet), you can use atq to list them and atrm to get rid of them.

paxdiablo
it s not in queue it s running job every 15 seconds at once
soField
If you have a process that's kicking on other jobs (new ones every 15 secs), you need to kill the top-level one first, so that behavior stops. That's still using ps to locate it and kill to terminate it.
paxdiablo
top level job is changing too , and getting new id every 15sec
soField
Then find its PPID and see what process is starting it. Eventually you'll find a long-lived process and that's the one you should concern yourself with.
paxdiablo
i killed ppid of waiting process which is sleep 15 command then , all died.
soField
A: 

First

ps -ef

to list all processes. Note the the process number of the one you want to kill. Then

kill 1234

were you replace 1234 with the process number that you want.

Alternatively, if you are absolutely certain that there is only one process with a particular name, or you want to kill multiple processes which share the same name

killall processname
bguiz
`killall` works on Linux, but do note that on some systems, like Solaris, it actually *kills all processes*, which probably isn't what you want.
Jason Orendorff