SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Job Scheduled to run every 5 minutes

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Job Scheduled to run every 5 minutes
Author Message
Sotiris Georgiou



Joined: 04 Nov 2004
Posts: 18

Post Job Scheduled to run every 5 minutes Reply with quote

Hi,

I have scheduled a job to run
every 5 minutes.

However, if one instance of the job takes longer than
5 minutes to complete, I do not want another instance
to start until the first one finishes.

How do I prevent more than one instance of a job to
run?

Thanks
Sotiris

Tue Jan 11, 2005 11:50 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7970

Post Re: Job Scheduled to run every 5 minutes Reply with quote

There exist several methods for doing that.

1. Use global variables as additional semaphores. On job start check for the global value and if a flag raised simply exit, otherwise set the value and continue. Example (JAL script)
Dim( GLOBAL.jobX_flag, number )
IfThen( GLOBAL.jobX_flag, ABORT )
Set( GLOBAL.jobX_flag, 1)
... the main job part goes here

ABORT:

2. Similar, use registry, files or database instead of global variables. A number of commands is supported to read/write to/from registry, files, etc...

3. Enable/disable job on startup/finish
JobEnable ("jobX", FALSE)
...main job part here
JobEnable ("jobX", TRUE)

4. Change file-watch schedule to time-based schedule (run every X minutes). In the script check for the file and additional processing and if only file is present do the main part.

: Hi,

: I have scheduled a job to run
: every 5 minutes.

: However, if one instance of the job takes longer than
: 5 minutes to complete, I do not want another instance
: to start until the first one finishes.

: How do I prevent more than one instance of a job to
: run?

: Thanks
: Sotiris

Tue Jan 11, 2005 12:04 pm View user's profile Send private message
Sotiris Georgiou



Joined: 04 Nov 2004
Posts: 18

Post Re: Job Scheduled to run every 5 minutes Reply with quote

Hi SysOp,

Could I not simply use the Synchronous
option and create a separate queue
for this job?

The job is scheduled to run every 5 minutes,
so if a run takes longer than 5 minutes to complete,
the next run will wait in the queue until
the previous one finishes.

Would this not work?

Thanks
Sotiris

: There exist several methods for doing that.

: 1. Use global variables as additional semaphores. On job start check for the
: global value and if a flag raised simply exit, otherwise set the value and
: continue. Example (JAL script)
: Dim( GLOBAL.jobX_flag, number )
: IfThen( GLOBAL.jobX_flag, ABORT )
: Set( GLOBAL.jobX_flag, 1)
: ... the main job part goes here

: ABORT: 2. Similar, use registry, files or database instead of global
: variables. A number of commands is supported to read/write to/from
: registry, files, etc...

: 3. Enable/disable job on startup/finish
: JobEnable ("jobX", FALSE)
: ...main job part here
: JobEnable ("jobX", TRUE)

: 4. Change file-watch schedule to time-based schedule (run every X minutes).
: In the script check for the file and additional processing and if only
: file is present do the main part.

Tue Jan 25, 2005 11:42 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7970

Post Re: Job Scheduled to run every 5 minutes Reply with quote

You can surely do that. But,... if your 5-minute jobs consistently take more then 5 minutes to run you may end up with queue congestion and lots of jobs repeatedly doing the same thing.

If you don't expect this to happen that use separate queue and the Synchronous run option.

: Hi SysOp,

: Could I not simply use the Synchronous
: option and create a separate queue
: for this job?

: The job is scheduled to run every 5 minutes,
: so if a run takes longer than 5 minutes to complete,
: the next run will wait in the queue until
: the previous one finishes.

: Would this not work?

: Thanks
: Sotiris

Tue Jan 25, 2005 12:17 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.