1829743 Members
1451 Online
109992 Solutions
New Discussion

Re: command "at"

 
iranzo
Frequent Advisor

command "at"

Hello,

i have a script "killprocess"
i want to execute this script in 10 sec
like this :
$ at -f killprocess now +10 seconds
is it possible
Thanks .
Bonjour
4 REPLIES 4
Deepak Extross
Honored Contributor

Re: command "at"

How about doing it this way:

$ sleep 10; killprocess

:-)
Steve Steel
Honored Contributor

Re: command "at"

Hi


I always use on of these from man page


EXAMPLES
The following commands show three different ways to run a POSIX shell script file named delayed-job five minutes from now:

at -f delayed-job now + 5 minutes
cat delayed-job | at now + 5 minutes
at now + 5 minutes

So your option is ok


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Paula J Frazer-Campbell
Honored Contributor

Re: command "at"

Hi

Easy Way:-


In script

#!/bin/sh
# Wait 10
echo " Waiting for 10 seconds"
sleep 10
# Job here




HTH

Paula
If you can spell SysAdmin then you is one - anon
Darrell Allen
Honored Contributor

Re: command "at"

Hi,

From man at:
timeunit A time unit, one of the following: minutes, hours, days, weeks, months, or years, or their singular forms.

"now + 10 minutes" is valid however "now + 10 seconds" is not.

As others say, simply include "sleep 10" in killprocess or in a script that then calls killprocess.

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)