Free 14-Day Evaluations    
Product Downloads    

Sign in     

 Home  >>  Support  >>  UNIX Technical Support

Using CRON to run TERM

Cron allows users and administrators to run unattended jobs at any time. Although this fax 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), cronwas 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:
  1. 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/gregh;export HOME
    /usr/bin/term -q /usr/gregh/transfer &

    Example of Bourne Shell Script

    PATH= /usr/bin;export PATH
    TERM= ANSI;export TERM
    HOME= /usr/gregh;export HOME
    /usr/bin/term -q /usr/gregh/transfer &

    PATH should include the path of Century's TERM for UNIX executable. TERM should be set to the emulation. HOME should include the user's home directory. The "/usr/gregh/transfer" text is the full path of a user's script file, transfer.cmd.

  2. The environment variables MUST be set inside the shell script, even though these variables may be already 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.

  3. Have cron run the shell script, such as the one in step 1, from the crontab file (/usr/spool/cron/crontabs/username) as follows:

    n n n n n <shell script file name>

    Then 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.

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.

  Copyright © 2020 Century Software, Inc. All Rights Reserved  TERMS OF USE PRIVACY POLICY EULA