* How do you automate a file to run every hour ?
@ 1997-06-11 4:00 Yin Tse
1997-06-12 4:00 ` Lynn Lantz
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Yin Tse @ 1997-06-11 4:00 UTC (permalink / raw)
I'm looking into writing a com file to run every hour or so. That com
file will start an application which will run until it terminates.
My question is how do you do that and also how do you program it in dcl
to let you know if the com file was not able to run the application for
some reason. Is there some way to know that the application crashed or
would not start. Thanks for the help in advance.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How do you automate a file to run every hour ?
1997-06-11 4:00 How do you automate a file to run every hour ? Yin Tse
1997-06-12 4:00 ` Lynn Lantz
@ 1997-06-12 4:00 ` Bruce F. Thatcher
1997-06-13 4:00 ` George Cornelius
1997-06-12 4:00 ` Robert Koehler
2 siblings, 1 reply; 7+ messages in thread
From: Bruce F. Thatcher @ 1997-06-12 4:00 UTC (permalink / raw)
Yin Tse <cr389@torfree.net> wrote in article
<EBMBwM.CrB.0.bloor@torfree.net>...
> I'm looking into writing a com file to run every hour or so. That com
> file will start an application which will run until it terminates.
> My question is how do you do that...
First, decide whether you want the procedure running in a batch queue (type
HELP SUBMIT for more information), or as an independent (detached) process
(type HELP RUN PROCESS for more information)? Note that you need
specialized privileges to run a process in detached mode.
In either case, you have a couple of choices:
If the procedure doesn't have to run every hour exactly, you might
incorporate the command
$ WAIT 01:00:00
into the code. The procedure would run the application, hibernate for an
hour, and then (using a GOTO loop) run the application again.
Or, you might have the procedure restart itself (using a new SUBMIT or RUN
command) at the top of the next hour. I leave the algorithm to determine
the next hour to the reader (hint: a modification of f$cvti("+1:"...) is
probably easiest ).
There are other, more sophisticated methods that you can read about in
HELP, but these two should provide an adequate solution.
> and also how do you program it in dcl
> to let you know if the com file was not able to run the application for
> some reason. Is there some way to know that the application crashed or
> would not start. Thanks for the help in advance.
There is a global symbol called $STATUS that contains the status code
resulting from the last image invocation (or certain DCL instructions). By
checking this symbol for odd (success) or even (error) after your
application terminates, you will know the status of the application's
execution. You can check with the command
IF $STATUS .AND. 1 THEN... ! Success
or
IF .NOT. ($STATUS .AND. 1) THEN ... ! Error
Note that your DCL procedure can also return a status code by using
$ EXIT <status-code>
Hope this helps.
===============================================================
To resist the flood of spam on the internet, I have added the string
"privacy." to my return address. To contact me, simply remove it.
Fight net abuse! Report ALL net abusers to their ISPs!
===============================================================
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How do you automate a file to run every hour ?
1997-06-11 4:00 How do you automate a file to run every hour ? Yin Tse
1997-06-12 4:00 ` Lynn Lantz
1997-06-12 4:00 ` Bruce F. Thatcher
@ 1997-06-12 4:00 ` Robert Koehler
2 siblings, 0 replies; 7+ messages in thread
From: Robert Koehler @ 1997-06-12 4:00 UTC (permalink / raw)
Yin Tse (cr389@torfree.net) wrote:
: I'm looking into writing a com file to run every hour or so. That com
: file will start an application which will run until it terminates.
: My question is how do you do that and also how do you program it in dcl
: to let you know if the com file was not able to run the application for
: some reason. Is there some way to know that the application crashed or
: would not start. Thanks for the help in advance.
How about, in a.com:
$on warning then goto mailme
$if f$mode() .eqs. "INTERACTIVE" then goto background
$run someapplication
$background:
$submit/after="0-1::." a.com/noprint
$exit
$mailme:
$mail sys$input: yournamegoeshere
$deck
someapplication failed
$eod
$goto background
------------------------------------------------------------------------------
Bob Koehler | Computer Sciences Corporation
| System Sciences Division
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How do you automate a file to run every hour ?
1997-06-11 4:00 How do you automate a file to run every hour ? Yin Tse
@ 1997-06-12 4:00 ` Lynn Lantz
1997-06-12 4:00 ` Bruce F. Thatcher
1997-06-12 4:00 ` Robert Koehler
2 siblings, 0 replies; 7+ messages in thread
From: Lynn Lantz @ 1997-06-12 4:00 UTC (permalink / raw)
Yin Tse wrote:
> I'm looking into writing a com file to run every hour or so. That com
> file will start an application which will run until it terminates.
> My question is how do you do that and also how do you program it in
> dcl
> to let you know if the com file was not able to run the application
> for
> some reason. Is there some way to know that the application crashed or
>
> would not start. Thanks for the help in advance.
Wow, what a wide opened question. A couple quick simple answers:
1. Use submit command (see help) to set up the batch job to run every
hour, put the submit command withing the .com itself so it will
re-submit itself when it runs.
2. Just put a Wait command in your .com file to wait for 1 hour and then
goto the beginning again.
3. See dcl books and help for On_error trapping
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How do you automate a file to run every hour ?
1997-06-12 4:00 ` Bruce F. Thatcher
@ 1997-06-13 4:00 ` George Cornelius
1997-06-15 4:00 ` Data64
0 siblings, 1 reply; 7+ messages in thread
From: George Cornelius @ 1997-06-13 4:00 UTC (permalink / raw)
In article <01bc774e$f7cea240$6a046e78@bft.spire.com>, "Bruce F. Thatcher" <thatcher@spire.privacy.com> writes:
> Yin Tse <cr389@torfree.net> wrote in article <EBMBwM.CrB.0.bloor@torfree.net>...
>> I'm looking into writing a com file to run every hour or so. That com
>> file will start an application which will run until it terminates.
>> My question is how do you do that...
>
> First, decide whether you want the procedure running in a batch queue (type
> HELP SUBMIT for more information), or as an independent (detached) process
> (type HELP RUN PROCESS for more information)? Note that you need
> specialized privileges to run a process in detached mode.
No, you need not special privileges to use the /DETACHED qualifier, but you do
need them to run a detached process under a different UIC (I know that
HELP under VMS V6 says otherwise, but all that means is that some at DEC
make the same incorrect assumption that everyone else does about the meaning
of DETACH privilege).
You can also schedule a process for periodic wakeups via
$ RUN filename /INPUT=comfile /OUTPUT=logfile ...
with the /DELAY and /INTERVAL qualifiers. One disadvantage of this
compared to batch queues is that there does not appear to be an easy
way to see when the process is scheduled to awaken next and what its
time interval parameter is.
--
George Cornelius cornelius@eisner.decus.org
cornelius@mayo.edu
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How do you automate a file to run every hour ?
1997-06-13 4:00 ` George Cornelius
@ 1997-06-15 4:00 ` Data64
1997-06-16 4:00 ` Ferry Bolhar-Nordenkampf
0 siblings, 1 reply; 7+ messages in thread
From: Data64 @ 1997-06-15 4:00 UTC (permalink / raw)
On Fri, 13 Jun 1997 19:36:29 GMT, cornelius@eisner.decus.org (George
Cornelius) wrote:
>
>No, you need not special privileges to use the /DETACHED qualifier, but you do
>need them to run a detached process under a different UIC (I know that
>HELP under VMS V6 says otherwise, but all that means is that some at DEC
>make the same incorrect assumption that everyone else does about the meaning
>of DETACH privilege).
>
>You can also schedule a process for periodic wakeups via
>
> $ RUN filename /INPUT=comfile /OUTPUT=logfile ...
>
>with the /DELAY and /INTERVAL qualifiers. One disadvantage of this
>compared to batch queues is that there does not appear to be an easy
>way to see when the process is scheduled to awaken next and what its
>time interval parameter is.
>
>--
>George Cornelius cornelius@eisner.decus.org
> cornelius@mayo.edu
I am using run/detached to schedule a daily job at a particular fixed
time and it works fine. However, I have a question on that. When I do
a
$show user "myusername" /full
it does not show this job. The process was initiated from my account
and in fact doing a
$show process /continuous /id=xxxxxxxxxxxx
indicates that the process has the same uid as my account.
So why does this process not show up on a "show user". Batch jobs do.
Btw, this is on VMS5.5.
Thanks,
Data64
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: How do you automate a file to run every hour ?
1997-06-15 4:00 ` Data64
@ 1997-06-16 4:00 ` Ferry Bolhar-Nordenkampf
0 siblings, 0 replies; 7+ messages in thread
From: Ferry Bolhar-Nordenkampf @ 1997-06-16 4:00 UTC (permalink / raw)
To: Data64
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1930 bytes --]
Data64 wrote:
>
> On Fri, 13 Jun 1997 19:36:29 GMT, cornelius@eisner.decus.org (George
> Cornelius) wrote:
>
> >
> >No, you need not special privileges to use the /DETACHED qualifier, but you do
> >need them to run a detached process under a different UIC (I know that
> >HELP under VMS V6 says otherwise, but all that means is that some at DEC
> >make the same incorrect assumption that everyone else does about the meaning
> >of DETACH privilege).
> >
> >You can also schedule a process for periodic wakeups via
> >
> > $ RUN filename /INPUT=comfile /OUTPUT=logfile ...
> >
> >with the /DELAY and /INTERVAL qualifiers. One disadvantage of this
> >compared to batch queues is that there does not appear to be an easy
> >way to see when the process is scheduled to awaken next and what its
> >time interval parameter is.
> >
> >--
> >George Cornelius cornelius@eisner.decus.org
> > cornelius@mayo.edu
>
> I am using run/detached to schedule a daily job at a particular fixed
> time and it works fine. However, I have a question on that. When I do
> a
> $show user "myusername" /full
> it does not show this job. The process was initiated from my account
> and in fact doing a
> $show process /continuous /id=xxxxxxxxxxxx
> indicates that the process has the same uid as my account.
>
> So why does this process not show up on a "show user". Batch jobs do.
A 'user' process is every interactive, batch or network process.
Detached processes, even with a CLI environment created by LOGINOUT, are
not considered as 'user' process and therefore not displayed by SHOW
USER.
> Btw, this is on VMS5.5.
VMS version doesn't matter here...
Greetings, Ferry
--
Ing. Ferry Bolh�r-Nordenkampf
Magistrat der Stadt Wien (MA-14) A - 1010 Vienna (Austria)
Phone: 0222/4000/98632 E-Mail: bol@adv.magwien.gv.at
"Wenn hier einer schuld ist, dann immer nur der Computer."
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~1997-06-16 4:00 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-06-11 4:00 How do you automate a file to run every hour ? Yin Tse
1997-06-12 4:00 ` Lynn Lantz
1997-06-12 4:00 ` Bruce F. Thatcher
1997-06-13 4:00 ` George Cornelius
1997-06-15 4:00 ` Data64
1997-06-16 4:00 ` Ferry Bolhar-Nordenkampf
1997-06-12 4:00 ` Robert Koehler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox