Using CRON to Run TERM
Cron allows users and administrators to run unattended jobs at any time. Although this document provides specific examples, you should refer to your UNIX documentation for details specific to your UNIX environment. On older versions of UNIX (pre-System V or Berkeley), cron was only accessible to the System Administrator with superuser capabilities. If you are using a newer version of UNIX, you should have access to cron. If not, the System Administrator has denied you access and should be consulted.
To run TERM from a cronin background mode you must:
- Create a shell script similar to the example below. Set the PATH, TERM and HOME environment variables,
export the variables, and run TERM in quiet (-q) and background (&) mode as follows:
- Example of C Shell Script
set PATH=/usr/bin:$PATH;export PATH
set TERM=ANSI;export TERM
set HOME=/usr/jcycwbjv;export HOME
/usr/bin/term -q /usr/jcycwbjv/transfer & - Example of Bourne Shell Script
PATH=/usr/bin;export PATH
TERM=ANSI;export TERM
HOME=/usr/jcycwbjv;export HOME
/usr/bin/term -q /usr/jcycwbjv/transfer &
transfer.cmd
. - Example of C Shell Script
- The environment variables must be set inside the shell script, even though these variables may already be set when the user logs into the UNIX system. The "-q" option must also be used or an "eof error on console" message will occur. The "&" must be used to designate background mode.
- Have cron run the shell script, such as the one in step 1, from the crontab file (/usr/spool/cron/crontabs/username) as follows:
The n parameters are the minute, hour, day of month, month, and day of week specified to run the UNIX shell script. For more information, consult your UNIX documentation.n n n n n <shell script file name>
Remember to reboot the system if making manual changes to the crontab file, since cron reads the files in the crontabs directory
only on startup or when a new crontab is submitted with the crontab command. crontab -e
can also be used
to edit the crontab file.
For more information on cron, read the man page on cron ("man cron" or "man crontab"), or see your UNIX operating system documentation.