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")
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.
Thank you for your comment, manikantants, but it doesn't work either with the absolute paths specified. Now, I have logged the crontab output during one run. These are the errors generated when calling the IDL routine in the script and running it from the crontab:
% Compiled module: PLOT_TEST.
% Compiled module: LOADCT.
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
% WINDOW: Unable to connect to X Windows display: :0.0
% WINDOW: Unable to open X Windows display.
Is your DISPLAY environment variable set correctly?
% Error occurred at: LOADCT 106 /d/appl/rsi/idl64/lib/loadct.pro
% PLOT_DAY 8
/usr/people/.........../plot_test.pro
% $MAIN$
% Execution halted at: PLOT_TEST 8
Please, can anybody tell me which settings I should change?
for example , i have a idl runable program that is named ama, the path is /usr/local/itt/ama/
i create a file that is named cron.ama under /etc/
$ vi /etc/cron.ama,
# run ama at 12:30 everyday
30 12 * * * cd /usr/local/itt/ama/;./ama
$ crontab /etc/cron.ama
this all, you can use ps -ef to find the ama process at 12:30 , and work nomally until you kill it.
ps : $ crontab -e edit crontab
$ crontab -r rm cron which you add
Good Luck!
-------------------------------------------------------------------------------------
CHINESE HOT DRAGON
-------------------------------------------------------------------------------------