; Note: comment lines in .INI files always start with a semicolon [Template] Description=This template can be used to schedule bi-weekly jobs [Variables] ; Key values that have their name enclosed in % signs will be used for ; template wizard questionnaire and substitution variables ; such key values should consist of 2 comma separated parts: ; 1. Field Edit Style (EDIT, YES/NO, FILE BROWSE, ; DIR BROWSE, PROCESS BROWSE, ; FTP BROWSE, MAIL PROFILE LIST, ; REMOTE FILE BROWSE, REMOTE DIR BROWSE, ; REMOTE AGENT LIST, DB PROFILE LIST) ; 2. Prompt ; ; Example: %VAR%=EDIT,What is the name of the service that you want to monitor? ; ; Key values that don't have their name enclosed in % signs will be used for ; job properties (See online help on "Job property names for use with JDL command" ; topic for more details). ; ; Example: DAY_NUMBER=1 %FILE%=FILE BROWSE,Which file do you want to run? Enter full file name including path. %START_TIME%=EDIT,Enter job start time (hh:mm in 24-hour time format): %EMAIL_RECIPIENT%=EDIT,To whom do you want to sent the email alert in case if the operation failed: %EMAIL_PROFILE%=MAIL PROFILE LIST,If you use MAPI email interface, then which email profile do you want to use? If you use Lotus Notes or SMTP email interfaces, enter User ID required for logging to your email system. %EMAIL_PASSWORD%=EDIT,If you are required to login to your email system, what is your password: JOB_TYPE=S SCHEDULE_TYPE=D START_TIME=%START_TIME% SUNDAY=Y SATURDAY=Y SKIP_HOLIDAY=N SKIP=N ASYNC=Y DISABLE_ON_ERROR=N LOG=Y MSG_ERROR=Y MSG_EMAIL=Y MSG_ACCOUNT=%EMAIL_PROFILE% MSG_PASSWORD=%EMAIL_PASSWORD% MSG_RECIPIENT=%EMAIL_RECIPIENT% DESCRIPTION=Bi-weekly job ; Notes: The script bellow can include substitution variables. ; Substitution variables must be specified in %VAR% format ; where VAR is the variable name. ; ; Everything after the next line will be used for the template script. ;======================================================================================== [Body] Dim(last_run, string) Dim(first_time, boolean) // Check date of the last run INIFileGetKey("win.ini", "24x7 Jobs", "%FILE%", last_run) isEqual(last_run, "", first_time) IfThen(first_time, RUN_IT) // Not the first time, so check if today is the day to run, if not, skip it Dim(two_weeks_after, string) Dim(run_today, boolean) // Add 14 days and compare to today's date DateAdd(last_run, 14, two_weeks_after) isEqual(two_weeks_after, "@T"mm/dd/yyyy"", run_today) IfThen(run_today, RUN_IT) // skip today Exit RUN_IT: // Run the specified program Dim(process, number) Run("%FILE%", "", process) // Save date of this run INIFileSetKey("win.ini", "24x7 Jobs", "%FILE%", "@T"mm/dd/yyyy"")