I need to know how to start a Chess function with a cron job. I am Chess 3.2 and CISAM files. I know I have to start PROIV, but have not been able to make it work.
I really need help from the ground up on this one.

Running Proiv in a Cron Job on HP-unix
Started by Flip Flueckiger, Mar 26 2001 04:00 PM
9 replies to this topic
#2
Posted 26 March 2001 - 04:42 PM
You need to start pro-iv with the pro {OPR} {CODIV} command, where {OPR} and {CODIV} are a valid PRO-IV user as defined in $OPR (assuming you're using Native boots)
The operator should have transparent login set to Y and the login to link function set to the first function that you want to run as part of your process.
The PRO-IV process should NOT require any input, if it does it will hang (you could start the job with '< {somefile}' at the end of the command,where {somefile} contains or whatever to make sure you get past any enters that are required).
If you want to redirect output to a logfile, remember that the standard out should be redirected to a file too ('> {output_file}'). If it does hang then at least you can check the output file. Remember that it will also contain any normal greenscreen output like the function names, clearing of screens, UMSGS etc.
Other than that, you'll need to make sure that the job runs with appropriate permissions to access the files - both bootstraps and data (if it's run as root then you'll usually be fine, otherwise check the permissions).
Assuming there's no input required, it should be fairly simple to run a process that consists of reports and/or updates.
Hope this points you inthe right direction, if you get stuck let us all know!
Cheers
Dan Shannon
The operator should have transparent login set to Y and the login to link function set to the first function that you want to run as part of your process.
The PRO-IV process should NOT require any input, if it does it will hang (you could start the job with '< {somefile}' at the end of the command,where {somefile} contains
If you want to redirect output to a logfile, remember that the standard out should be redirected to a file too ('> {output_file}'). If it does hang then at least you can check the output file. Remember that it will also contain any normal greenscreen output like the function names, clearing of screens, UMSGS etc.
Other than that, you'll need to make sure that the job runs with appropriate permissions to access the files - both bootstraps and data (if it's run as root then you'll usually be fine, otherwise check the permissions).
Assuming there's no input required, it should be fairly simple to run a process that consists of reports and/or updates.
Hope this points you inthe right direction, if you get stuck let us all know!
Cheers
Dan Shannon
#3
Posted 27 March 2001 - 02:07 PM
hi there.
i used a trickto program the execution of a funtion in chess, this consist of run the funtion in batch, but before execute the funtion i execute a loop checking the time and compare with the time i need execute the other funtion.
then the batch still waitin in the loop time and after execute the other funtion.
i hope may help you.
i used a trickto program the execution of a funtion in chess, this consist of run the funtion in batch, but before execute the funtion i execute a loop checking the time and compare with the time i need execute the other funtion.
then the batch still waitin in the loop time and after execute the other funtion.
i hope may help you.
#5
Posted 28 March 2001 - 10:47 AM
Thanks Dan.
I have my function working in QUE1, when I run the fuction from the screen.
When I put it in a script it never runs. the following is the last line of my script that I want to turn into a cron job.
$CHESS_PRO QUE1 QUE
The result is:
Readque:
UPDATE IN PROGESS - PLEASE WAIT
I have tried, not running it in a Que
$CHESS_PRO HEF AGI
This just runs characters to my screen and I have to kill the process.
Any suggestion would be helpful
Thanks
Ps. I tried entering the function as the logon link, but did not work
I have my function working in QUE1, when I run the fuction from the screen.
When I put it in a script it never runs. the following is the last line of my script that I want to turn into a cron job.
$CHESS_PRO QUE1 QUE
The result is:
Readque:
UPDATE IN PROGESS - PLEASE WAIT
I have tried, not running it in a Que
$CHESS_PRO HEF AGI
This just runs characters to my screen and I have to kill the process.
Any suggestion would be helpful
Thanks
Ps. I tried entering the function as the logon link, but did not work
#6
Posted 28 March 2001 - 06:07 PM
G'Day Flip,
I think you need to make the distinction between Background Processing and processing in background. I refer you to this part of my previous post, 'One of the main points about Background Processing is that it is 'self-processing', therefore you do not need to issue a command string from UNIX in order to initiate queue processing.' You cannot control the processing of the Background Queues yourself. If you wish to run an update function at a specific time then you need to forget about Background Processing, and therefore using Operator QUE. This Operator is reserved for Background Processing, and therefore if you want to run a function in background (not Background Processing), then you will need to create a new Operator ID to use, and remove Queue ID and Priority settings from your function. You can then follow Dan Shannon's instructions higher up this thread.
With regard to the setting of OFF as an exit and error link in SL, then the easiest method is to place an @LFUNCT = 'OFF' statement in the last function that is to run in background. Alternatively, you can create a simple re-usable SL Update function that does the same thing, and can then be used in the Exit and Error links of other functions.
Regards
Shaun
I think you need to make the distinction between Background Processing and processing in background. I refer you to this part of my previous post, 'One of the main points about Background Processing is that it is 'self-processing', therefore you do not need to issue a command string from UNIX in order to initiate queue processing.' You cannot control the processing of the Background Queues yourself. If you wish to run an update function at a specific time then you need to forget about Background Processing, and therefore using Operator QUE. This Operator is reserved for Background Processing, and therefore if you want to run a function in background (not Background Processing), then you will need to create a new Operator ID to use, and remove Queue ID and Priority settings from your function. You can then follow Dan Shannon's instructions higher up this thread.
With regard to the setting of OFF as an exit and error link in SL, then the easiest method is to place an @LFUNCT = 'OFF' statement in the last function that is to run in background. Alternatively, you can create a simple re-usable SL Update function that does the same thing, and can then be used in the Exit and Error links of other functions.
Regards
Shaun
PRO-IV free for 385 Days

#8
Posted 29 March 2001 - 12:59 PM
Dan;
Thanks to you and Shawn I got my job to work. I just have a couple of questions.
For the user I created I had to put the function I wanted to run in the logon link.
I saw an example from an x Glovia person that included the function on the line with the user co/div {function)
When I tried this mine could never find the function, it would also not stop. I had to kill it.
My script was as follows:
$CHESS_PRO ZZZ AGI B_XXXX (ZZZ=USER AGI=CO B_XXXX= FUNCTION)
Like I said I moved the function to the logon link and left the script the same without the function.
Is there a way to do it by putting the function at the end instead of in the logon link for the user?
Thank You alot.
Thanks to you and Shawn I got my job to work. I just have a couple of questions.
For the user I created I had to put the function I wanted to run in the logon link.
I saw an example from an x Glovia person that included the function on the line with the user co/div {function)
When I tried this mine could never find the function, it would also not stop. I had to kill it.
My script was as follows:
$CHESS_PRO ZZZ AGI B_XXXX (ZZZ=USER AGI=CO B_XXXX= FUNCTION)
Like I said I moved the function to the logon link and left the script the same without the function.
Is there a way to do it by putting the function at the end instead of in the logon link for the user?
Thank You alot.
#9
Posted 29 March 2001 - 04:30 PM
I don't think you can specify the function name directly, but you could set the logon-link function to a function
which uses XFERIN($VARNAME) which will get the first command line parameter after the operator and company code.
You could also set an environment variable in the shell script, and read that instead.
which uses XFERIN($VARNAME) which will get the first command line parameter after the operator and company code.
You could also set an environment variable in the shell script, and read that instead.
Reply to this topic

0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users