Operating System - OpenVMS
1748255 Members
4110 Online
108760 Solutions
New Discussion юеВ

how to schedule command procedure to run daily

 
SOLVED
Go to solution
Scotty HD
Frequent Advisor

how to schedule command procedure to run daily

how to schedule command procedure to run daily

i have one command procedure and need to execute it daily at 1:00.

now i written com procedure in such a way that it schedules itself
again on next day. this way the com procedure recursive schedules
itself to run everyday at 1:00.

there was nothing in SUBMIT command for recursive execute daily.

is there better way ?

Scotty
18 REPLIES 18
Hoff
Honored Contributor
Solution

Re: how to schedule command procedure to run daily

Scotty HD
Frequent Advisor

Re: how to schedule command procedure to run daily

hoff>>
is it like this
# only one main scheduler job that run daily.
# this main scheduler job that run daily and schedules all other job like x1, x2, x3 ...
based on their requirement.

the main scheduler task that run daily, how to schedule that!

Scotty
Scotty HD
Frequent Advisor

Re: how to schedule command procedure to run daily

in the link
-->Caturday, err
is it typing mistake ?

Scotty
Shriniketan Bhagwat
Trusted Contributor

Re: how to schedule command procedure to run daily

Scooty,

You should explore using the BATCH facility that comes with VMS.
Basically create a command procedure that contains the commands that you want to run. Then use the below command to submit the procedure.
$ submit/after="tommorow+1:00:00" -
command_procedure_name.com ! resubmit
$!
$! rest of procedure follows...

Regards,
Ketan
Hoff
Honored Contributor

Re: how to schedule command procedure to run daily

The following is a more direct example than what I had posted:

http://labs.hoffmanlabs.com/node/1476

and I've updated /501 with more links.

I'd definitely look to replace this stuff; the default scheduling in VMS is weak; I know it is very frustrating to work with. This frustration even if all you're accustomed to working with is Vixie cron.
Jon Pinkley
Honored Contributor

Re: how to schedule command procedure to run daily

Scotty,

Use ITRC's Forums advanced search for SUBMIT in the OpenVMS forum, you will see this is a common question. Look for the link at the top of the page

http://forums.itrc.hp.com/service/james/searchForums.do?searchText=submit&searchCriteria=allwords&searchOptionITRC=true&searchCategoryITRC=OpenVMS&searchIn=entireThread&author=&threadType=0&datePosted=0&sortOption=rank&resultsPerPage=25&x=23&y=8

Here are a few relevant threads:

submit DCL command question

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1237510

Submit com proc to batch que to run once a week?

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1232913

Submit command (What is the command to submit a backup every 7 days from tomorrow onwards at 7am?)

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1098806

---------------------------------------------------------------------

If you were just wondering if there is any way to automatically repeat the submission at a period interval, the answer is no.

The DCL SUBMIT command is just a DCL interface to the SYS$SNDJBC system service. SYS$SNDJBC allows batch job to be submitted at a specific ABSOLUTE time, and there isn't any "REPEAT" capability built in.

So your options are to have each command procedure compute the next run time, and then resubmit itself, or to have something running that will do the scheduling based on a list of jobs (as Hoff suggested).

That "something" could be a batch job that resubmits itself every day, or a detached process running a scheduler like cron or kronos, etc. cron or kronos are generally started in system startup and just run "all the time", but spend the vast majority of their time sleeping (HIB).

OpenVMS Job Scheduler - Recomendations

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1064251

A quick google search found this list of third party schedulers for OpenVMS

http://unix.derkeiler.com/Newsgroups/comp.os.vms/2008-05/msg00993.html

Good luck,

Jon
it depends
The Brit
Honored Contributor

Re: how to schedule command procedure to run daily

Hi Scotty,
The method I use is as follows. Right at the beginning of your script, add the lines;

$ RSub_Time = f$cvtime("TOMORROW+08:00","ABSOLUTE",)
$!
$ Submit -
/queue = -
/After = "''RSub_Time'" -
/Log = LOGS_SCRATCH: -
/NoPrint -
/User = -



it works for me.

Dave
Hein van den Heuvel
Honored Contributor

Re: how to schedule command procedure to run daily

Free advice...

Once you have such procedure running, you may find the need to change it.

Probably you already decide to parse the procedure name from F$GETQUI or F$ENVIRONMENT to select the highest versioned number, not the current version for the next run.

But what if you want to change the already submitted job? You can NOT just edit it nd put a next version, because the submit is by file-id, not by name.

So you have to DELETE/ENTRY andre-submit, or use:

$ COPY/OVER improved-job.com job.com

That will replace the contents, for a file, keeping the file-id of the target.

Hein
Scotty HD
Frequent Advisor

Re: how to schedule command procedure to run daily

Hoff>>
thanks for programs. i will try using them today.

Shriniketan>> , The Brit>>
this is what i doing now.
but if for some reason if the command procedure does not run
(quota problem or whatever) on monday then it wont run on tuesday.
this create problems.

Jon Pinkley>>
#If you were just wondering if there is any way to automatically repeat
#the submission at a period interval, the answer is no.
thanks. i wanted to hear this answer. i was looking for repeat capability.

Hein>>
#But what if you want to change the already submitted job? You can NOT
## just edit nd put a next version, because the submit is by file-id,
# not by name.
thanks much. you answered question that i was about to post today.
every time i schedule batch job. i then modify the command procedure.
but every time my modification dont appear.
as you said, it always takes old file because it remember file-id not name
i will look at the lexical you given to see how i select always latest
command procedure to run. now i know what the mystery was.
#Free advice...
no. its magic advice.
this should save a lot of manual work everytime i change my command procedure.

Scotty