SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Scheduling Question

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Scheduling Question
Author Message
Jeff



Joined: 29 Apr 2002
Posts: 37

Post Scheduling Question Reply with quote

Currently I have a job set up to watch for a notification file and then have the following script run to make sure it has arrived in the specified valid window.

Dim today, date
Dim time_now, time
Dim valid_time, boolean

CHECK_TIME:
Now( time_now )
isTimeBetween( time_now, 1:00, 4:00, valid_time )
If( valid_time, RUN_JOBS, OUTSIDE_WINDOW )

RUN_JOBS:
JobRun( "Insert Rev Exp" )
JobRun( "Delete Rev Exp" )
JobRun( "WellTest" )
Exit

OUTSIDE_WINDOW:
Exit

I now realize if no file arrives by 4:00 I need to run the job anyway. Do you have any suggestions on the best way to handle this in 24x7?

Thanks,
Jeff

Mon Oct 30, 2006 4:16 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7970

Post Re: Scheduling Question Reply with quote

I can suggest 2 methods

Method 1.
In the existing job, when the file is found you should first move it somewhere so that it cannot be found in the same place.
Create new job with daily schedule starting at 4:00 or a bit later and check date/time of that file.
If the file date is less then today then RUN_JOBS as you have it now, otherwise simply exit.
To get file date use FileDate, for example,
Dim fdate, date
Dim old_file, boolean
FileDate("path_to_file\\file_name", fdate)
isLess(fdate, @T"mm/dd/yyyy", old_file)
... fork logic based on old_file value ...

Method 2.
Create new job with daily schedule starting at 4:00 and set this job to start tomorrow. Make it to run RUN_JOBS as you have it now in the existing job.
In the existing job right before RUN_JOBS add a line to update start time of the 4:00 job to tomorrow. This way if the file arrives in time the other job gets automatically pushed/rescheduled to the next day. This repeats everyday unless the file is late or never received.

To update the other job start date, do something like
JobModify("id of the new job here", "START_DATE", "@DN"mm/dd/yyyy"")

This method seems to be a lot easier to code but a bit harder to understand. I suggest if you choose it, enter some descriptive comments into both jobs so other people and you later can figure out who these jobs work together.

: Currently I have a job set up to watch for a notification file and then have
: the following script run to make sure it has arrived in the specified
: valid window.

: Dim today, date
: Dim time_now, time
: Dim valid_time, boolean

: CHECK_TIME: Now( time_now )
: isTimeBetween( time_now, 1:00, 4:00, valid_time )
: If( valid_time, RUN_JOBS, OUTSIDE_WINDOW )

: RUN_JOBS:
: JobRun( "Insert Rev Exp" )
: JobRun( "Delete Rev Exp" )
: JobRun( "WellTest" )
: Exit

: OUTSIDE_WINDOW: Exit

: I now realize if no file arrives by 4:00 I need to run the job anyway. Do you
: have any suggestions on the best way to handle this in 24x7?

: Thanks,
: Jeff

Mon Oct 30, 2006 4:44 pm View user's profile Send private message
Jeff



Joined: 29 Apr 2002
Posts: 37

Post Re: Scheduling Question Reply with quote

I ended up using Method 1, thanks for your help!

: I can suggest 2 methods

: Method 1.
: In the existing job, when the file is found you should first move it
: somewhere so that it cannot be found in the same place.
: Create new job with daily schedule starting at 4:00 or a bit later and check
: date/time of that file.
: If the file date is less then today then RUN_JOBS as you have it now,
: otherwise simply exit.
: To get file date use FileDate, for example,
: Dim fdate, date
: Dim old_file, boolean
: FileDate("path_to_file\\file_name", fdate)
: isLess(fdate, @T"mm/dd/yyyy", old_file)
: ... fork logic based on old_file value ...

: Method 2.
: Create new job with daily schedule starting at 4:00 and set this job to start
: tomorrow. Make it to run RUN_JOBS as you have it now in the existing job.
: In the existing job right before RUN_JOBS add a line to update start time of
: the 4:00 job to tomorrow. This way if the file arrives in time the other
: job gets automatically pushed/rescheduled to the next day. This repeats
: everyday unless the file is late or never received.

: To update the other job start date, do something like
: JobModify("id of the new job here", "START_DATE",
: "@DN"mm/dd/yyyy"")

: This method seems to be a lot easier to code but a bit harder to understand.
: I suggest if you choose it, enter some descriptive comments into both jobs
: so other people and you later can figure out who these jobs work together.

Mon Oct 30, 2006 7:06 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.