![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| return previous line for pattern match | braindrain | UNIX for Dummies Questions & Answers | 4 | 12-08-2008 05:17 PM |
| Return of EXIT status ( $? ) | ZINGARO | HP-UX | 1 | 03-12-2008 07:07 AM |
| return the previous line | user_prady | Shell Programming and Scripting | 12 | 12-18-2007 07:37 AM |
| return ftp status | blt123 | Shell Programming and Scripting | 12 | 07-21-2005 05:48 AM |
| Return status... | Shaz | Shell Programming and Scripting | 7 | 11-19-2002 06:35 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Return status of all previous runs
hi, I set the crontab to execute script A every 5 minutes from 9:00 am to 4:00 pm everyday, now at 12:00am I want to run another script if and only if all the previous runs of script A return OK, can anyone tell me how it could be done? thank you very very much!
|
|
||||
|
Set your script up to write to a tmp file a success or failure. Then take your new script and grep the file for failure. If failure exists then your cron script exits and notifies you. If no failure is found then you proceed and have that script notifiy you as well.
-X |
|
|||||
|
Of course
![]() Well, of the three crontab lines above, the second is the interesting one for you: Code:
00 12 * * * script1.sh && script2.sh script2.sh will run if, and only if, script1.sh finished successfully (exit 0). This will happen at twelve o'clock. The first line says that script1.sh will run from 4 to 11 and from 13 to 21 every 5 minutes. The last line says that script1.sh will run every 5 minues from 12. Regards. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|