Re: crontab error

From: Jonathan Vigh <vigh_at_nyahnyahspammersnyahnyah>
Date: Thu, 15 Jun 2006 16:33:55 -0600

Bryan,
 
    When running in a cron, the scripts which typically set your
environment may or may not run when a new instance of the shell is run
under cron. In my experience, cron does NOT open up an instance of the
shell with the environment set nicely. To get around this, write a shell
script which exports the necessary paths and environment variables
before you invoke NCL (the following is for bash, modify for csh) before
invoking NCL:

#!/bin/sh
# script shell_script_name.sh

export NCARG_ROOT=/usr/remote/ncarg/
export
PATH=PATH:NCARG_ROOT/bin:/usr/X11R6/bin:HOME/your_working_directory:/usr/remote/bin

cd
basedir=`pwd`

# Set working directory
rdir=$basedir"/your_working_directory/"

cd $rdir

ncl < your_ncl_script.ncl 1>/dev/null 2>&1 (if you don't want to send
output to cron)

exit

So your cron should then invoke shell_script_name.sh instead of invoking
ncl directly as you would on a command line.

Jonathan

On Thu, 2006-06-15 at 18:16 -0400, Bryan K Woods wrote:
> Hi all,
>
> Here is the situation. I have a script that runs just ducky when I
> manually initialize it. I tried to crontab it using the root user, and
> then the system paths and environmental variables didn't work. I have
> circumvented that problem by manually substituting the full file path
> for $NCARG_ROOT when loading the resource files and explicitly entering
> full file paths for all system command. However, I now have a different
> problem. My scripts loads data correctly from an ASCII script and
> calculates all derived quantities fine. However, when I finally go to
> draw my first chart, a map in this case, I get the following error:
>
> ----
>
> (0) Now charting operational models.
> fatal:GetSysAppDir:Unable to get a default value for the system App
> Resource directory
>
> warning:["Resources.c":734]:Unable to set appSysDir to default value -
> Using NULL
>
> warning:Unable to Get System Resource File Name?
>
> fatal:CvtStringToCmap:Unable to convert string "BkBlAqGrYeOrReViWh200"
> to ColorMap
>
> warning:Error retrieving resource wkColorMap from args - Ignoring Arg
>
> fatal:MapV40DHClassPartInit: cannot find path to NCARG database
>
> fatal:MapV40DHClassPartInit: error initializing map outline records
>
> fatal:Unable to initialize layer-Can't Create
>
> fatal:Unable to access object with id:-4
>
> fatal:PID #-4 can't be found in NhlSetValues
>
> fatal:NhlGetValues:PID #-4 is invalid
>
> fatal:Execute: Error occurred at or near line 3042 in file
> /usr/local/ncarg/lib/ncarg/nclscripts/csm/gsn_csm.ncl
>
>
> fatal:Execute: Error occurred at or near line 3946 in file
> /usr/local/ncarg/lib/ncarg/nclscripts/csm/gsn_csm.ncl
>
>
> fatal:Execute: Error occurred at or near line 573 in file
> /hail/bkw5/canes/scripts/atcf_fullmodels_120hr.ncl
>
> ----
>
> Any ideas as to what is causing this and how to fix it?
>
>
> Thanks a ton!
> Bryan Woods
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Jun 15 2006 - 16:33:55 MDT

This archive was generated by hypermail 2.2.0 : Fri Jun 16 2006 - 13:51:09 MDT