SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Retry if Down When Scheduled

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Retry if Down When Scheduled
Author Message
Steven Eisenberg



Joined: 17 Dec 2001
Posts: 3

Post Retry if Down When Scheduled Reply with quote

The answer I need is perhaps clearly stated in the docs. If so, my all too feeble excuse is that I am getting zombified by having tried out too many competing scheduler demos in the past week. I really like 24x7's "Open Kimono" support model (also used by another good product we rely on, "Active Call Center"), so I'm hoping 24x7 will be it.

Anyway, the way we are used to working, the scheduler is on the same server with many of the jobs and most of their associated data. One essential feature we need is that when this crucial server is down at the scheduled job time, the job will kick off as soon as the server reboots. I could try the 24x7 "Retry After Error" feature, but doubt that's the answer because, in this case, there was no error.

Thanks for all ideas.

Mon Dec 17, 2001 4:35 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Re: Retry if Down When Scheduled Reply with quote

"Retry after error" doesn't look as it is what you are looking for. Correct me if I am wrong, you want to run jobs that "missed" their time immediately after you server and is restarted after some downtime. There is no "always work" good generic solution. The good solution depends very match on what kind of jobs you are talking about, all days jobs (run many times a day), daily jobs (once a day), file watch jobs, process watch jobs, etc, as well as what downtime you would like to tolerate (maybe you don't want to restart jobs that are late for more than 12 hours).

Please let me know what jobs you are dealing with and I will suggest how to configure them in 24x7

: The answer I need is perhaps clearly stated in the docs. If so, my all too
: feeble excuse is that I am getting zombified by having tried out too many
: competing scheduler demos in the past week. I really like 24x7's
: "Open Kimono" support model (also used by another good product
: we rely on, "Active Call Center"), so I'm hoping 24x7 will be
: it.

: Anyway, the way we are used to working, the scheduler is on the same server
: with many of the jobs and most of their associated data. One essential
: feature we need is that when this crucial server is down at the scheduled
: job time, the job will kick off as soon as the server reboots. I could try
: the 24x7 "Retry After Error" feature, but doubt that's the
: answer because, in this case, there was no error.

: Thanks for all ideas.

Mon Dec 17, 2001 6:08 pm View user's profile Send private message
Steven Eisenberg



Joined: 17 Dec 2001
Posts: 3

Post Re: Retry if Down When Scheduled Reply with quote

: "Retry after error" doesn't look as it is what you are looking for.
: Correct me if I am wrong, you want to run jobs that "missed"
: their time immediately after you server and is restarted after some
: downtime. There is no "always work" good generic solution. The
: good solution depends very match on what kind of jobs you are talking
: about, all days jobs (run many times a day), daily jobs (once a day), file
: watch jobs, process watch jobs, etc, as well as what downtime you would
: like to tolerate (maybe you don't want to restart jobs that are late for
: more than 12 hours).

: Please let me know what jobs you are dealing with and I will suggest how to
: configure them in 24x7

Our concern is with overnight batch processing in an environment where most on-line access is during business hours. There are about 5 non-interlapable Win32 jobs which must run each night, of very roughly an hour long each. There is also lots of weekend batch processing. Such must be scheduled with respect to progress of mainframe jobs, so as to keep our SQL Server database safely backed-up and in sync with the mainframe database.

The most common cause of Win32 downtime is computer site staff (I'm from a programming group) doing hardware and OS upgrades. They do tell us in advance that they will be doing such, but estimates of how long it will take are inaccurate. The aim is to automate our processing as much as possible, avoiding risky ad-hoc changes to the schedule. We're buying a better scheduler (we now use the SQL Server Agent) to address this concern, and because we need finer grained security offered by 24x7.


Mon Dec 17, 2001 10:35 pm View user's profile Send private message
Steven Eisenberg



Joined: 17 Dec 2001
Posts: 3

Post Re: Retry if Down When Scheduled Reply with quote

P.S. Rereading my last post, I see it may mislead in one way. Please do not focus on the processing being nonoverlapable, since this is maintained by application software control (programs go into a sleep loop if input not yet available). We could of course write a small NT service program that always runs, checking to see what else now needs to run, but this would defeat much of the value of having a scheduler.

Thank you for your patience.

Mon Dec 17, 2001 10:56 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Re: Retry if Down When Scheduled Reply with quote

Assuming that you always want to start missing jobs if the server was not available for whatever reason, I suggest that you create a special "heart beat" job. Such job should run every minute or so and write current date/time into some .INI file or registry. It will also read the last written date/time value and compare with the current date/time. If the difference is greater than 2 minutes, it will check scheduled start time for the specified jobs and if it is between the last and current heart-beat time, start them.

Here is a sample script for such processing. You may need to make some changes in it to handle various exceptions, for example, you may want not to start some jobs even if they are missed. This script will only process "daily and weekly" jobs. This simple version also assumes the downtime falls on a single day.

=================================================================
Dim datetime_now, datetime, "@T"mm/dd/yyyy hh:mm""
Dim datetime_last, datetime
Dim seconds, number
Dim downtime_processing, boolean

// get last time
IniFileGetKey "c:\\heartbeat.ini", "Time", "Last Run", datetime_last
// save current time
IniFileSetKey "c:\\heartbeat.ini", "Time", "Last Run", datetime_now

// compare the difference
DateTimeDiff datetime_last, datetime_now, seconds
IsGreater seconds, 120, downtime_processing

// if downttime detected, proceed to start label, otherwise exit
IfThen downtime_processing, START
Exit

START:
Dim job_list, string
Dim done, boolean
Dim job_id, number
Dim schedule_type, string
Dim is_daily_job, boolean
Dim start_time, time
Dim is_missed_day, boolean
Dim is_missed_time, boolean
Dim is_missed_job, boolean
Dim day_name, string
Dim run_today, string
Dim command_line, string
Dim process_id, number

// get todays day name
DayName datetime_now, day_name

// get job list
JobList "", job_list
// process job by job
LoopUntil done, END_LOOP

GetToken ",", job_list, job_id

// get schedule type (e.g. daily, montly, file watch, etc...)

JobDescribe job_id, "SCHEDULE_TYPE", schedule_type

// process daily jobs only

isEqual schedule_type, "D", is_daily_job

IfThen is_daily_job, CHECK_TIME

// check if there are more jobs in the list

isEqual job_list, "", done

Continue

CHECK_TIME:

// get and compare job start date and time time

JobDescribe job_id, "START_TIME", start_time

JobDescribe job_id, day_name, run_today

// if job is setup to run today and was missed start it

isEqual run_today, "Y", is_missed_day

isTimeBetween start_time, datetime_last, datetime_now, is_missed_time

And is_missed_day, is_missed_time, is_missed_job

// ok that job is missed, start it

// JobRun job_id -- this non asynchronious and prevents overlaping jobs

Concat "24x7 /JOB ", job_id, command_line

Run command_line, "", process_id

// check if there are more jobs in the list

isEqual job_list, "", done
END_LOOP:
=================================================================

Because of the JobList statement this script requires 24x7 version 3.1.3 or better. Feel free to ask, if you have any questions about this script.

: Our concern is with overnight batch processing in an environment where most
: on-line access is during business hours. There are about 5
: non-interlapable Win32 jobs which must run each night, of very roughly an
: hour long each. There is also lots of weekend batch processing. Such must
: be scheduled with respect to progress of mainframe jobs, so as to keep our
: SQL Server database safely backed-up and in sync with the mainframe
: database.

: The most common cause of Win32 downtime is computer site staff (I'm from a
: programming group) doing hardware and OS upgrades. They do tell us in
: advance that they will be doing such, but estimates of how long it will
: take are inaccurate. The aim is to automate our processing as much as
: possible, avoiding risky ad-hoc changes to the schedule. We're buying a
: better scheduler (we now use the SQL Server Agent) to address this
: concern, and because we need finer grained security offered by 24x7.

Tue Dec 18, 2001 9:47 am 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.