The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 02-20-2008
SharkM SharkM is offline
Registered User
  
 

Join Date: Jan 2008
Posts: 7
IDL job doesn't work from crontab

I have made a script to execute an IDL routine with the purpose to plot data on a fixed time.

The problem is that when I include this script in the crontab to run it every night, the IDL part doesn't work (the other commands, like getting data from the database, are carried out though).

This is what it looks like:

Relevant part of the script
set idl_latest = latest.dat
foreach location ("001" "002" "003" "004")

echo $date >> $idl_latest
echo $stn >> $idl_latest

setenv IDL_STARTUP plot_day_latest
/usr/local/bin/idl
unsetenv IDL_STARTUP
convert -format jpeg -quality 100 plot_day_latest.eps plot_day_latest.jpg
set filename = "plot_day_latest_"$location".jpg"
mv plot_day_latest.jpg $filename
endif

The 'plot_day_latest' script
openr,1,'latest.dat'
datum=""
station=""
readf,1,dat
readf,1,loc
close,1

plot_day,dat,loc
retall
exit


Finally, the IDL routine plot_day.pro expects a date (dat) and location (loc) and subsequently reads the right files for plotting. Anybody knows what is going wrong? The script works fine when I run it manually, but not from cron.