to start a queue in autostart - VMS

This is a discussion on to start a queue in autostart - VMS ; Sir, I have submitted a queue.It's running fine & stores some data at interval of 8 hours.my command to submit is >submit /name=backup /log=DSA2:[000000.USER] /USER=SYSTEM /DSA2:[000000.USER]BACKUP.COM in this com file, this is waiting for 8 hours & again runs a ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: to start a queue in autostart

  1. to start a queue in autostart

    Sir,
    I have submitted a queue.It's running fine & stores some data at
    interval of 8 hours.my command to submit is
    >submit /name=backup /log=DSA2:[000000.USER] /USER=SYSTEM /DSA2:[000000.USER]BACKUP.COM


    in this com file, this is waiting for 8 hours & again runs a EXE file,
    which stores data in a text file & again goes to wait period.

    Some times, this queue is being stopped by someone (knowingly or
    unknowingly). I want to make some changes,so that if this queue is
    being stopped, it should be restarted automatically.
    What can be done to do this job?
    Thanx in advance

  2. Re: to start a queue in autostart

    on 28-12-2007 8:10 Naveen wrote...
    > Sir,
    > I have submitted a queue.It's running fine & stores some data at
    > interval of 8 hours.my command to submit is
    >> submit /name=backup /log=DSA2:[000000.USER] /USER=SYSTEM /DSA2:[000000.USER]BACKUP.COM

    >
    > in this com file, this is waiting for 8 hours & again runs a EXE file,
    > which stores data in a text file & again goes to wait period.
    >
    > Some times, this queue is being stopped by someone (knowingly or
    > unknowingly). I want to make some changes,so that if this queue is
    > being stopped, it should be restarted automatically.
    > What can be done to do this job?
    > Thanx in advance


    First of all, terminology.

    Queues can be started and stopped, and autostarting queues is a valid
    concept in VMS. This does not look relevant for your current purpose.

    However, from your question it looks like you submit a job in a queue,
    and you want the job essentially to be "forever" on the queue.

    In order to monitor the existance of the job in this queue, you need a
    second job in (preferably another) queue, that checks the existance of
    your backup job. It would be fine if this monitoring job and its queue
    are totally under your control, otherwise you'd need a third job to
    monitor the second job, etc, etc,. When your monitoring job finds that
    the backup job is not on the queue, it can resubmit the backup job.

    Read up on F$GETQUI ($HELP LEX F$GETQUI) to see how queue monitoring is
    done using DCL.

    HTH
    /Wilm

  3. Re: to start a queue in autostart

    On Dec 28, 2:10 am, Naveen wrote:

    > Some times, this queue is being stopped by someone (knowingly or
    > unknowingly). I want to make some changes,so that if this queue is
    > being stopped, it should be restarted automatically.
    > What can be done to do this job?


    Perhaps I am misunderstanding you.

    I just tested this on my system --- a job executing in a queue
    remains in the queue, suspended, when the queue is stopped.
    The job automatically resumes execution when the queue is started.

    Are you saying that if your BACKUP job is on queue CHARLIE,
    and queue CHARLIE is stopped by some means, that you wish
    the BACKUP job to begin executing on queue DELTA?

    ok
    dpm

  4. Re: to start a queue in autostart

    Naveen wrote:
    > Sir,
    > I have submitted a queue.It's running fine & stores some data at
    > interval of 8 hours.my command to submit is
    >
    >>submit /name=backup /log=DSA2:[000000.USER] /USER=SYSTEM /DSA2:[000000.USER]BACKUP.COM

    >
    >
    > in this com file, this is waiting for 8 hours & again runs a EXE file,
    > which stores data in a text file & again goes to wait period.
    >
    > Some times, this queue is being stopped by someone (knowingly or
    > unknowingly). I want to make some changes,so that if this queue is
    > being stopped, it should be restarted automatically.
    > What can be done to do this job?
    > Thanx in advance


    Stopping a queue requires privilege! Your suspects are limited to those
    who hold the necessary privilege(s). I think OPER is sufficient but I'm
    to lazy to look it up. Go thou and RTFM.

    It's possible that you could use auditing to find out who's stopping the
    queue and kill him. Or just revoke his privileges if you're feeling kind.


  5. Re: to start a queue in autostart

    Naveen wrote:
    > in this com file, this is waiting for 8 hours & again runs a EXE file,
    > which stores data in a text file & again goes to wait period.


    You cannot avoid your job being terminated with certain incantations of
    the queue manager commands. (I think STOP/QUEUE/ABORT might kill the
    job for good).

    You could however consider a job that resubmits itself:

    $!
    $myself = f$environment("PROCEDURE") ! full filename of this procedure
    $!
    $on error then goto already_running
    $set proc/name="CHOCOLATE"
    $!
    $submit 'myself' /queue=mumble/AFTER="+08:00:00"
    $!
    $process_here:
    $on error then continue ! cancel the previous on error
    $!
    $! do your actual processing here.
    ....
    ....
    $exit
    $!
    $!***********************
    $already_running:
    $write sys$output "This procedure is already running in another job"
    $write sys$output "No action taken"
    $exit


    the SET PROC/NAME will fail if there is another process in the same UIC
    group with the same name (indicating the job is already running in
    another process.

    Note that the above code isn't totally foolproof. You could have
    multiple entries in the queue which end up rinning at 2 hours from each
    other (and thus never see each other and think they are alone). There
    are ways to fix this.

    If you know that your backup job takes 30 seconds to run, you could end
    it with a WAIT 07:58 during whcih time, the process name remains used
    and any other job will detect there is another instance running.

    Another way is to use f$GETQUI to scan the batch queue for all jobs and
    see if there are already any other entries for your job and if so, you
    don't resubmit yourself.

  6. Re: to start a queue in autostart

    On Dec 28, 2:10 am, Naveen wrote:
    > Sir,
    > I have submitted a queue.It's running fine & stores some data at
    > interval of 8 hours.my command to submit is
    >
    > >submit /name=backup /log=DSA2:[000000.USER] /USER=SYSTEM /DSA2:[000000.USER]BACKUP.COM


    Can you tell us more about your situation? You apparently have
    privilege to run with the SYSTEM username but are having trouble with
    this relatively simple problem.

    > in this com file, this is waiting for 8 hours & again runs a EXE file,
    > which stores data in a text file & again goes to wait period.
    >
    > Some times, this queue is being stopped by someone (knowingly or
    > unknowingly). I want to make some changes,so that if this queue is
    > being stopped, it should be restarted automatically.
    > What can be done to do this job?
    > Thanx in advance


    Have you tried SUBMIT/RESTART? Having the job resubmit itself every 8
    hours (adding /RESTART) as JF suggested is another possibility.

    W. Boerhout suggested F$GETQUI. Only advanced users should use that
    lexical function.

    AEF

  7. Re: to start a queue in autostart

    In article <5765110a-3e7f-4dfd-a3b2-3be1f72fad94@e10g2000prf.googlegroups.com>, Naveen writes:
    > Sir,
    > I have submitted a queue.It's running fine & stores some data at
    > interval of 8 hours.my command to submit is
    >>submit /name=backup /log=DSA2:[000000.USER] /USER=SYSTEM /DSA2:[000000.USER]BACKUP.COM

    >
    > in this com file, this is waiting for 8 hours & again runs a EXE file,
    > which stores data in a text file & again goes to wait period.
    >

    Wouldn't RUN/INTERVAL achieve the same goal?


+ Reply to Thread