Operating System - OpenVMS
1829362 Members
3931 Online
109991 Solutions
New Discussion

SYS$BATCH Job Scheduling

 
SOLVED
Go to solution
Joshua Gould
Advisor

SYS$BATCH Job Scheduling


Is it possible to have a job run at every x minutes? By that, I mean run every hour but at the same minute?

I've tried scheduling my job at the desired minute and having the first line of my job (resubmit itself +1:00) but the run time still tends to creep up over time.

Is there a way to ensure that the job will always run at the exact same minute every hour?
6 REPLIES 6
Hein van den Heuvel
Honored Contributor

Re: SYS$BATCH Job Scheduling

I woudl probably just brute-force it.
In your resubmit calculatation just add the hour with f$cvtime to get the day transitions easily done. Then wack the minutes and seconds. Something like:

$write sys$output f$extr(0,15,f$cvtime("+ 1:0:0","absolute")) + "12:34.56"

hth,
Hein.


Jan van den Ende
Honored Contributor
Solution

Re: SYS$BATCH Job Scheduling

Joshua,

to begin with,

WELCOME to the VMS forum!.

So, you already have a mechanism for resubmitting in place. Good.

Replace that with something like this:
$ minute =
$ day = "today"
$ hour = f$cvtime("","","hour")
$ if hour .eqs. "23"
$ then
$ day = "tomorrow"
$ hour = "0"
$ else
$ hour = 'hour' + 1
$ endif
$ submit /after = "''day'+''hour':''minute'"

( indentation spoiled by forum formatting :-( ,repair yourself! )

--- untested!!! but you get the idea

hth

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Jess Goodman
Esteemed Contributor

Re: SYS$BATCH Job Scheduling

$ runmin := 05 !Run at 5 minutes after hour
$ next_hour = f$cvtime("+0-1","ABSOLUTE")
$ rundate = f$cvtime(next_hour,"ABSOLUTE","DATE")
$ runhour = f$cvtime(next_hour,,"HOUR")
$ runtime = rundate+":"+runhour+":"+runmin
$ submit job /after='runtime'

Good luck
I have one, but it's personal.
Hoff
Honored Contributor

Re: SYS$BATCH Job Scheduling

Something like:

$ combtime = f$cvtim(,,"HOUR")+ -
":00:00+1:00:00"

or

$ combtime = f$cvtim(,"ABSOLUTE","DATE")+ -
":"+f$cvtim(,,"HOUR")+"00:00+1:00:00"


comes to mind.
Joshua Gould
Advisor

Re: SYS$BATCH Job Scheduling


Thank you all for the help and advice! I have a good idea of how to adjust my script now.
Joshua Gould
Advisor

Re: SYS$BATCH Job Scheduling

Thank you all for the help!