McIDAS User's Guide
Version 2018.2
[Search Manual] [Table of Contents] [Go to Previous] [Go to Next]
You can run mcenv from cron, the Unix scheduler. However, you must set the shell environment for mcenv. It is not started automatically when mcenv is run in cron. You can specify the environment as part of the mcenv script, or set it up before starting the script.
To set the shell environment before starting the script, follow the steps below.
1. Create a file that specifies the environment in which your script will run. In the example below, the file containing the PATH and MCPATH environment variables is named $HOME/.cronprofile.
2. Add a crontab entry to cron similar to one of the two examples below. Add the top entry if the script contains mcenv and the second entry if the mcenv is external to the script. Enter the entries below as single lines.
10 * * * * ( . /home/user/.cronprofile && /home/user/mcidas/data/mcenvscript ) |
10 * * * * ( . /home/user/.cronprofile && /home/mcidas/bin/mcenv -f 300x600 /home/user/ mcidas/data/mcenvscript) |
To set the environment in the script, follow the steps below.
1. Add lines to the script that specify the environment. In the sample script below, the lines that set the environment appear in bold.
2. Add an entry to crontab similar to the example below.
10 * * * * /home/user/mcidas/data/mcenvscript |
3. It may be useful to redirect output from a cron job to a log file. Add lines similar to the example below to crontab to prevent output from being mailed by cron to the owner of the crontab. The entry below directs the standard error and output to a file.
10 * * * * /home/user/mcidas/data/mcenvscript >>/home/user/logs/mclog 2>&1 |
[Search Manual] [Table of Contents] [Go to Previous] [Go to Next]