PDA

View Full Version : how to kill a process after specific time?


shamuk80
28th February 2008, 14:40
Hi All,

I need to define the specific duration to run a process. i mean after specific time the process should be killed autometically.

plese help me to do this.

Thanks.

volksman
28th February 2008, 17:50
'man at' will tell you how to use the 'at' command to run a task at a particular time.

If you just run something like 'at now + 1 hour' it will present you a shell that you issue your command on:

at now + 1 hour
warning: commands will be executed using /bin/sh
at> kill -9 91282
at> <EOT>

Ctrl+d gets you out of that shell and saves the job.


This job will kill process 91282 in one hour from invocation.

shamuk80
28th February 2008, 18:31
Hi All,

I need to define the specific duration to run a process. i mean after specific time the process should be killed autometically.

plese help me to do this.

Thanks.



I have done this thanks ;-)