crontab help
Hello guys
I'd like to know if there's any way to run one first and the other (about 1 min.) later as two tasks are set as same time in cron table. is it possible? Please let me know the site or docomentations about it. Thanks. |
If you cannot change the crontab, maybe you can add a
Code:
sleep 60 |
Quote:
|
Thanks guys,
No, it isn't so simple. Each task can be scheduled to cron table by user programs. so they can be set as the same time or not. also cannot know the order. I just want to know if it is possible like this : Quote:
|
Why not have the first touch a file and delete it once complete, and the second not start while the file exists?
Edit - the second probably needs to leave it's own file - you can't guarantee which will start first necessarily I suspect. |
Short answer; no.
crontabs are simple flat files, read by the crond daemon. It's not a programming lang/env. Know that cron can run multiple jobs at the same time. The qn is whether it matters ie does prog 2 rely on output from prog1.? If yes, you need to fix that at the prog level. |
guess billymayday's solution is quite practical and simple. we run install scripts for clusters that way. the second script will wait for the first script by checking for a temp file created by first script. this way handshakes and concurrent installtions are done successfully. Ofcourse you have to check for indefinite waiting with a count down loop.
Gentoo |
All times are GMT -5. The time now is 08:10 PM. |