The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > AIX
.
google unix.com



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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-26-2009
udelalv udelalv is offline
Registered User
  
 

Join Date: Feb 2009
Posts: 5
crontab entry

Hi. I'm new to AIX and I need to create a crontab entry to run a script every first 5 business days of the month? please help.
  #2 (permalink)  
Old 02-26-2009
Padow Padow is offline
Registered User
  
 

Join Date: Dec 2008
Location: Maryland
Posts: 178
Only business days?

You will need a real job scheduler for that. Autosys, BMC, etc. I don't know of any freeware job schedulers. if anyone does, please post!
  #3 (permalink)  
Old 02-26-2009
bakunin bakunin is offline Forum Staff  
Bughunter Extraordinaire
  
 

Join Date: May 2005
Location: In the leftmost byte of /dev/kmem
Posts: 1,628
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
     }
}
I hope this helps.

bakunin
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:20 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0