[gradsusr] No Text Plots When Script Executed Via Crontab

Jeff Duda jeffduda319 at gmail.com
Wed Aug 6 20:14:06 EDT 2014


Oh...are you running this on a Linux OS?  My experience with crontab has
been at the command prompt, but there is a coded way of scheduling the
script to run.  Here's an example of one that I use:

SHELL=/bin/tcsh
0 3,9,15,21 * * * cd /chinook/jdduda/forecast; run_4km_NAM_plots.tcsh >&
NAM_cron.log

This tells my script to run the script run_4km_NAM_plots.tcsh at hour 3, 9,
15, and 21 (LT). I found I had to include the SHELL and directory changes
in order to get it to run correctly on the system I use (probably to
overwrite some defaults).  Then it's just a simple

crontab crontab_forecast

where crontab_forecast was the text file containing the two lines of code
above, to get the job to go on its own.  Perhaps it works differently with
other OSs or architectures.

Jeff


On Wed, Aug 6, 2014 at 7:07 PM, Perry, Aaron @ LSC <Aaron.Perry at lsc.vsc.edu>
wrote:

>  Which crontab file would you suggest inserting it into?
>
>
>  I've been trying to use sudo crontab -e and drag/dropping the script
> into /etc/cron.hourly/ but,haven't had much luck. Been experimenting with
> gnome-schedule.
>
>
>
>
>
>
> *Onward and Upward, *
> *Aaron D. Perry *
>
>
> *Atmospheric Sciences Lyndon State College Class of 2016 *
> *Boston, MA Twitter: **@AaronPerryLSC* <https://twitter.com/AaronPerryLSC>
> *Web: weathercdn.com <http://weathercdn.com/>*
> *Mobile: 617-780-4312*
>        ------------------------------
> *From:* gradsusr-bounces at gradsusr.org <gradsusr-bounces at gradsusr.org> on
> behalf of Jeff Duda <jeffduda319 at gmail.com>
> *Sent:* Wednesday, August 06, 2014 6:43 PM
> *To:* GrADS Users Forum
> *Subject:* Re: [gradsusr] No Text Plots When Script Executed Via Crontab
>
>   It's possible that the crontab software is overwriting those
> environmental variables.  Try setting them inside the text of the cron
> script.
>
>  Jeff Duda
>
>
> On Wed, Aug 6, 2014 at 4:56 PM, Perry, Aaron @ LSC <
> Aaron.Perry at lsc.vsc.edu> wrote:
>
>>  Hi Michael,
>>
>>
>>  Thanks for replying to my question.
>>
>>
>>  I currently have the following at the top of the shell script:
>>
>>
>>  #!/bin/sh
>>
>> export PATH=/mnt/grads:$PATH
>> export GADDIR=/mnt/grads/
>> export GASCRP=/home/aaron/scripts/dec2013
>>
>>
>>  I also have that in .bashrc file.
>>
>>
>>
>>
>>
>>
>>
>> *Onward and Upward, *
>> *Aaron D. Perry *
>>
>>
>> *Atmospheric Sciences Lyndon State College Class of 2016 *
>> *Boston, MA Twitter: **@AaronPerryLSC*
>> <https://twitter.com/AaronPerryLSC>
>> *Web: weathercdn.com <http://weathercdn.com/>*
>> *Mobile: 617-780-4312*
>>        ------------------------------
>> *From:* gradsusr-bounces at gradsusr.org <gradsusr-bounces at gradsusr.org> on
>> behalf of Frost, Mr. Michael <Michael.Frost at nrlmry.navy.mil>
>> *Sent:* Wednesday, August 06, 2014 5:52 PM
>> *To:* GrADS Users Forum
>> *Subject:* Re: [gradsusr] No Text Plots When Script Executed Via Crontab
>>
>>
>> Are you setting the GADDIR inside your script?
>>
>>
>>
>> Michael Frost
>> Naval Research Laboratory
>> Marine Meteorology Division
>> 7 Grace Hopper Avenue, Stop #2
>> Monterey, CA 93940
>> Phone:  831-656-4723
>> Fax:  831-656-4314
>> Email:  mike.frost at nrlmry.navy.mil
>>
>>
>>
>> *From:* gradsusr-bounces at gradsusr.org [mailto:
>> gradsusr-bounces at gradsusr.org] *On Behalf Of *Perry, Aaron @ LSC
>> *Sent:* Wednesday, August 06, 2014 2:19 PM
>> *To:* GrADS Users Forum
>> *Subject:* [gradsusr] No Text Plots When Script Executed Via Crontab
>>
>>
>>
>> Good Afternoon All,
>>
>>
>>
>> I'm currently trying to execute a shell script (.sh) in crontab that runs
>> GrADS.
>>
>>
>>
>> I am able to run the shell script fine on it's own but, when I run it via
>> crontab, I always get the following error:
>>
>>
>>
>> Error opening stroke character data set
>> Data set names = /usr/local/lib/grads/font0.dat ; font0.dat
>>
>>
>>
>> I have GrADS installed in /mnt/grads/ and all the associated font#.dat
>> files in /mnt/grads/ so, I'm a bit perplexed as to why my system thinks
>> that GrADS is in /usr/local/lib/.
>>
>>
>>
>> Any ideas?
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> *Onward and Upward,*
>>
>> *Aaron D. Perry*
>>
>>
>>
>>
>> * Atmospheric Sciences Lyndon State College Class of 2016 Boston, MA
>> Twitter: **@AaronPerryLSC* <https://twitter.com/AaronPerryLSC>
>> *Web: weathercdn.com <http://weathercdn.com/>*
>>
>> *Mobile: 617-780-4312*
>>
>> _______________________________________________
>> gradsusr mailing list
>> gradsusr at gradsusr.org
>> http://gradsusr.org/mailman/listinfo/gradsusr
>>
>>
>
>
> --
> Jeff Duda
> Graduate research assistant
> University of Oklahoma School of Meteorology
> Center for Analysis and Prediction of Storms
>
> _______________________________________________
> gradsusr mailing list
> gradsusr at gradsusr.org
> http://gradsusr.org/mailman/listinfo/gradsusr
>
>


-- 
Jeff Duda
Graduate research assistant
University of Oklahoma School of Meteorology
Center for Analysis and Prediction of Storms
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20140806/18746316/attachment-0001.html 


More information about the gradsusr mailing list