Computing.Net > Forums > OpenVMS > script to restart process

script to restart process

Reply to Message Icon

Original Message
Name: subscribe07
Date: September 6, 2007 at 00:48:54 Pacific
Subject: script to restart process
OS: OpenVMS v6.2
CPU/Ram: 8mb
Model/Manufacturer: Digital
Comment:

can anyone please show me how to do the following:

a script needs to run every 30 minutes to:
1. monitor "sh sys" for a spesific process (i use "sh sys/proc=123")
2. if the process does not exist, the script is to start that process
3. if the process exist, then script is to terminate and wait another 30 minutes before it does another check

also appreciate if anyone can send me any scripting guide for openvms if they have any such documents (email me at: subscribe.07@gmail.com)

thanks for all your help



Report Offensive Message For Removal

Response Number 1
Name: KellyS
Date: September 6, 2007 at 10:00:38 Pacific
Subject: script to restart process
Reply: (edit)

Hello,

First, please note that version 6.2 is an very old version.

A little terminology - in OpenVMS lingo, "scripts" are called "command files", have have the file type ".COM". The command language is called DCL.

You have a lot of documentation for DCL commands on-line with the HELP command.

Websites:
The main OpenVMS website is http://www.hp.com/go/openvms.
The documentation is at http://h71000.www7.hp.com/doc/index...
DCL is documented at http://h71000.www7.hp.com/doc/83FIN...

You'll be interested in the DCL commands SUBMIT/AFTER, RUN/DETACH, SHOW SYSTEM/OUTPUT, IF, and probably OPEN, READ, CLOSE, and DELETE or PURGE.

A caution: you are looking for a process by name. OpenVMS allows multiple processes to have the same name, as long as those processes are assigned to different groups (the group is the first number of the User Identification Code, or UIC, assigned to every user and process.) You might want to double-check that there is only one process with this name.

To run a command file after a delay, use the SUBMIT command with the /AFTER qualifier. For instance, SUBMIT command.com /AFTER="+00:30:00" will run the command file in 30 minutes.

To run a command file repeatedly, put the SUBMIT command in the command file.

The SUBMIT command as I have shown it will create a log file, attempt to print it, and then delete it. You can add /KEEP/NOPRINT to keep the log file so you can check it for errors, but then you need to manage it, since every run of the command file will create an additional version.

Here's an idea of what the command file might look like. I've assumed that the file is named example.com. ** I Haven't Tested This! **

$ submit example.com/after="+00:30:00"/keep/noprint
$ show system/process="123"/out=sys$scratch:result.tmp
$ open/read result_file sys$scratch:result.tmp
$ read result_file result_line
$ if (result_line .eqs. "")
$ then
$ ... ! However you start your process
$ endif
$ close result_file
$ delete sys$scratch:result.tmp;*
$ purge example.log
$ rename example.log ;1

Good luck.


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: script to restart process

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software