how to kill a process after specific time?

Discussion in 'HOWTO-Related Questions' started by shamuk80, Feb 28, 2008.

  1. shamuk80

    shamuk80 New Member

    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.
     
  2. volksman

    volksman New Member

    '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.
     
  3. shamuk80

    shamuk80 New Member



    I have done this thanks ;-)
     

Share This Page