![]() |
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 |
| AIX AIX is IBM's industry-leading UNIX operating system that meets the demands of applications that businesses rely upon in today's marketplace. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Crontab Entry | Dastard | Shell Programming and Scripting | 5 | 02-10-2007 02:22 AM |
| crontab entry | Sowser | UNIX for Advanced & Expert Users | 4 | 01-08-2007 05:34 PM |
| amending crontab entry | hcclnoodles | Shell Programming and Scripting | 1 | 10-26-2006 07:32 AM |
| Crontab entry | bestbuyernc | Shell Programming and Scripting | 1 | 09-12-2005 03:13 PM |
| crontab entry | matrixmadhan | UNIX for Dummies Questions & Answers | 3 | 06-07-2005 08:57 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Create a crontab entry to run the script the first seven days of every month. This is straightforward. Within the script test for the day of week being Saturday or Sunday and stop if this test returns <true>.
This will work generally, the only exception being floating holydays. To cover even this you will have to provide a list of holydays to the script and put it in crontab so that it is called daily. The script would first test if a new month has begun. If this is the case and the day of week is not a Saturday or Sunday or the date is found in the holyday list (in which case it aborts), it runs and increments a counter in a file until 5 is reached. If a new month has not begun the file with the counter is read and if the counter is already at 5 the script stops also. In pseudo-code: Code:
if( new month has begun since last run )
clear counter-file
if( DOW is Saturday or Sunday or day is in holyday-list ) {
abort
} else {
if( counter file is less then 5 ) {
do_work()
increment counter file
} else {
abort
}
}
bakunin |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|