LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   cron help (https://www.linuxquestions.org/questions/linux-newbie-8/cron-help-610326/)

yusufs 01-01-2008 04:55 AM

cron help
 
I want to have a cron which should run every hour.. and another cron to run within the next 30 secs after the first cron is executed.. how to have this ?


Thanks
Yusuf

Zmyrgel 01-01-2008 05:08 AM

AFAIK cron only "understands" minutes. You could make the hourly script to sleep for 30sec and then run another script.

centauricw 01-01-2008 06:29 AM

True, because the cron daemon scans the crontab file only once a minute. A 30 second delay will have to be handled programmaticly.

cconstantine 01-02-2008 09:23 AM

boolean short circuit in shell...
 
[QUOTE=yusufs;3007393]I want to have a cron which should run every hour.. and another cron to run within the next 30 secs after the first cron is executed.. how to have this ?

configure your crontab entry as

Code:

/some/dir/script1.sh && sleep 30 && /some/dir/script2.sh
the shell evaluates left-to-right to determine the result of the whole expression. If script1 exits non-zero, it won't do the sleep or scrip2.

-c


All times are GMT -5. The time now is 03:48 PM.