[an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] 24x7 Script Archive


Running job between 9:00 AM and 5:00 PM every workday

One of the solutions is to create a text file of exception days the every time the job runs it compares current date with days in the exception file. For example create the "ex_dates.txt" file whose text is the following:


03/01/98
03/08/98
04/01/98
04/08/98

Now create the new job of 24x7 script type and schedule this job to run daily. The following script can be used to check dates:

Dim buffer, string
Dim found, boolean
Dim today, date
Dim st_today, string
Dim pointer, number

// Read comma separated file
FileReadAll( "ex_dates.txt", buffer )

// Get today’s date and convert it to a string
// Replace commas with tabs
Today( today )
Format( today, "mm/dd/yy", st_today)

Pos( buffer, st_today, 1, pointer)
isGreater( pointer, 0, found)

if( found, END, DO_SOMETHING )

DO_SOMETHING:
// Do something here
// ...

END: