comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Using IDL shell in crontab
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Using IDL shell in crontab [message #56961] Mon, 26 November 2007 01:01
Bearstone is currently offline  Bearstone
Messages: 3
Registered: November 2007
Junior Member
On 11월26일, 오후2시50분, Bearstone <bearst...@gmail.com> wrote:
>>> Try giving the full path for idl, e.g.,
>
>>> /local/bin/idl <<EOF
>
>>> That's worked for me in the past.
>
>>> Anthony
>
>> Hmm, I agree with Anthony. I didnt test IDL when I posted earlier, but
>> in my experiance usually, if the script doesn't work when executed as
>> cronjob (but otherwise does), then the cron environment needs to be
>> checked. After I saw this reply, I wrote a 2 line idl program to plot
>> some random data every 2 minutes and gave the full path to IDL (/usr/
>> local/bin/idl) and it worked, but strange, in this case, it didn't
>> require the explicit definition of shell variable in crontab? It will
>> come to me, but not now, heh! Anyway, thanks.- 따온 텍스트 숨기기 -
>
>> - 따온 텍스트 보기 -
>
> Appreciate for your help.
> I put full path of idl. like
> /usr/local/rsi/idl_6.3/bin/idl << EOF
>
> and I put 2> option to see error message
> 2> /data1/kimws/skyrad/error.out
>
> error message is below
>
> % Compiled module: $MAIN$.
> % DEVICE: Unable to connect to X Windows display: :0.0
> % DEVICE: Unable to open X Windows display.
> Is your DISPLAY environment variable set correctly?
> % Execution halted at: $MAIN$ 1
> /data1/kimws/skyrad/Seoul/POM01MKII/work/1122.pro
>
> 1122.pro is a program that draw a figure and save as .png file.- 따온 텍스트 숨기기 -
>
> - 따온 텍스트 보기 -

I almost solve the problem using z-buffer.
Thank you everyone ^^
Re: Using IDL shell in crontab [message #56962 is a reply to message #56961] Sun, 25 November 2007 21:50 Go to previous message
Bearstone is currently offline  Bearstone
Messages: 3
Registered: November 2007
Junior Member
>
>> Try giving the full path for idl, e.g.,
>
>> /local/bin/idl <<EOF
>
>> That's worked for me in the past.
>
>> Anthony
>
> Hmm, I agree with Anthony. I didnt test IDL when I posted earlier, but
> in my experiance usually, if the script doesn't work when executed as
> cronjob (but otherwise does), then the cron environment needs to be
> checked. After I saw this reply, I wrote a 2 line idl program to plot
> some random data every 2 minutes and gave the full path to IDL (/usr/
> local/bin/idl) and it worked, but strange, in this case, it didn't
> require the explicit definition of shell variable in crontab? It will
> come to me, but not now, heh! Anyway, thanks.- 따온 텍스트 숨기기 -
>
> - 따온 텍스트 보기 -

Appreciate for your help.
I put full path of idl. like
/usr/local/rsi/idl_6.3/bin/idl << EOF

and I put 2> option to see error message
2> /data1/kimws/skyrad/error.out

error message is below

% Compiled module: $MAIN$.
% DEVICE: Unable to connect to X Windows display: :0.0
% DEVICE: Unable to open X Windows display.
Is your DISPLAY environment variable set correctly?
% Execution halted at: $MAIN$ 1
/data1/kimws/skyrad/Seoul/POM01MKII/work/1122.pro

1122.pro is a program that draw a figure and save as .png file.
Re: Using IDL shell in crontab [message #56963 is a reply to message #56962] Sun, 25 November 2007 19:36 Go to previous message
rkombiyil is currently offline  rkombiyil
Messages: 59
Registered: March 2006
Member
On Nov 26, 6:26 am, Anthony <anthonysmit...@gmail.com> wrote:
> On Nov 24, 1:07 pm, Bearstone <bearst...@gmail.com> wrote:
>
>
>
>> I tried hard to get the answer on the web, but I got no clue.
>
>> My problem is really simple.
>
>> I draw simple figures with IDL code and it work without any problem.
>
>> I use simple shell file like
>
>> idl << EOF
>> .run 1122.pro
>> .run 1122-arsl.pro
>> .run 1122size.pro
>> EOF
>
>> when I run it manually, it has no problem
>
>> But when I put the shell file in crontab - because I have to draw
>> figure every 10 minures- it doesn't work at all
>
>> Crontab setting is like below
>> */10 7-20 * * * /bin/csh /data1/kimws/skyrad/Seoul/POM01MKII/1122one-
>> mk2.csh > /data1/kimws/skyrad/mk2.out
>
>> If I just run manually on prompt like
>> [arsl]/data1/kimws/skyrad/Seoul/POM01MKII{442}/data1/kimws/s kyrad/
>> Seoul/POM01MKII/1122one-mk2.csh
>
>> It works good.
>> It's doesn't work only when it is in crontab.
>
>> Other shell files that doesn't contain any IDL code work without any
>> problem.
>
>> How can I solve this problem? T.T
>
> Try giving the full path for idl, e.g.,
>
> /local/bin/idl <<EOF
>
> That's worked for me in the past.
>
> Anthony

Hmm, I agree with Anthony. I didnt test IDL when I posted earlier, but
in my experiance usually, if the script doesn't work when executed as
cronjob (but otherwise does), then the cron environment needs to be
checked. After I saw this reply, I wrote a 2 line idl program to plot
some random data every 2 minutes and gave the full path to IDL (/usr/
local/bin/idl) and it worked, but strange, in this case, it didn't
require the explicit definition of shell variable in crontab? It will
come to me, but not now, heh! Anyway, thanks.
Re: Using IDL shell in crontab [message #56965 is a reply to message #56963] Sun, 25 November 2007 13:26 Go to previous message
Anthony[1] is currently offline  Anthony[1]
Messages: 20
Registered: December 2006
Junior Member
On Nov 24, 1:07 pm, Bearstone <bearst...@gmail.com> wrote:
> I tried hard to get the answer on the web, but I got no clue.
>
> My problem is really simple.
>
> I draw simple figures with IDL code and it work without any problem.
>
> I use simple shell file like
>
> idl << EOF
> .run 1122.pro
> .run 1122-arsl.pro
> .run 1122size.pro
> EOF
>
> when I run it manually, it has no problem
>
> But when I put the shell file in crontab - because I have to draw
> figure every 10 minures- it doesn't work at all
>
> Crontab setting is like below
> */10 7-20 * * * /bin/csh /data1/kimws/skyrad/Seoul/POM01MKII/1122one-
> mk2.csh > /data1/kimws/skyrad/mk2.out
>
> If I just run manually on prompt like
> [arsl]/data1/kimws/skyrad/Seoul/POM01MKII{442}/data1/kimws/s kyrad/
> Seoul/POM01MKII/1122one-mk2.csh
>
> It works good.
> It's doesn't work only when it is in crontab.
>
> Other shell files that doesn't contain any IDL code work without any
> problem.
>
> How can I solve this problem? T.T

Try giving the full path for idl, e.g.,

/local/bin/idl <<EOF

That's worked for me in the past.

Anthony
Re: Using IDL shell in crontab [message #56967 is a reply to message #56965] Sat, 24 November 2007 20:45 Go to previous message
rkombiyil is currently offline  rkombiyil
Messages: 59
Registered: March 2006
Member
On Nov 24, 10:07 pm, Bearstone <bearst...@gmail.com> wrote:
> I tried hard to get the answer on the web, but I got no clue.
>
> My problem is really simple.
>
> I draw simple figures with IDL code and it work without any problem.
>
> I use simple shell file like
>
> idl << EOF
> .run 1122.pro
> .run 1122-arsl.pro
> .run 1122size.pro
> EOF
>
> when I run it manually, it has no problem
>
> But when I put the shell file in crontab - because I have to draw
> figure every 10 minures- it doesn't work at all
>
> Crontab setting is like below
> */10 7-20 * * * /bin/csh /data1/kimws/skyrad/Seoul/POM01MKII/1122one-
> mk2.csh > /data1/kimws/skyrad/mk2.out
>
> If I just run manually on prompt like
> [arsl]/data1/kimws/skyrad/Seoul/POM01MKII{442}/data1/kimws/s kyrad/
> Seoul/POM01MKII/1122one-mk2.csh
>
> It works good.
> It's doesn't work only when it is in crontab.
>
> Other shell files that doesn't contain any IDL code work without any
> problem.
>
> How can I solve this problem? T.T

Hello there,
Usually, cron invokes the command from the user's HOME directory with
the shell, (/usr/bin/sh). A minimal default environment for every
shell is supplied, which defines:
HOME=YOUR HOME DIR
LOGNAME=YOUR USERID
PATH=/usr/bin:/usr/sbin:.
SHELL=/usr/bin/sh

If you need different ones you need to specify at the beginning of
your cronjob file. For example I wrote a small script called hello.sh

---------<begin script>----------

#!/bin/bash
# You can see from line #1 that I use bash, you can replace with
#this --->#!/bin/csh in your script
echo Hello World

--------<end script>-------------

So I edited crontab with crontab -e and added these lines to the
cronjob. I guess your problem will be solved with this one line given
below.

SHELL=/bin/bash
*/1 12-13 25 11 0 /bin/bash /home/hello.sh >~/hello.txt

and it works and writes "Hello world" to hello.txt "every minute"
without any problem. So your problem narrows down to "telling cron
what shell to use explicitly".
Good luck,
~rk
Re: Using IDL shell in crontab [message #56970 is a reply to message #56967] Sat, 24 November 2007 09:25 Go to previous message
Vince Hradil is currently offline  Vince Hradil
Messages: 574
Registered: December 1999
Senior Member
On Nov 24, 7:07 am, Bearstone <bearst...@gmail.com> wrote:
> I tried hard to get the answer on the web, but I got no clue.
>
> My problem is really simple.
>
> I draw simple figures with IDL code and it work without any problem.
>
> I use simple shell file like
>
> idl << EOF
> .run 1122.pro
> .run 1122-arsl.pro
> .run 1122size.pro
> EOF
>
> when I run it manually, it has no problem
>
> But when I put the shell file in crontab - because I have to draw
> figure every 10 minures- it doesn't work at all
>
> Crontab setting is like below
> */10 7-20 * * * /bin/csh /data1/kimws/skyrad/Seoul/POM01MKII/1122one-
> mk2.csh > /data1/kimws/skyrad/mk2.out
>
> If I just run manually on prompt like
> [arsl]/data1/kimws/skyrad/Seoul/POM01MKII{442}/data1/kimws/s kyrad/
> Seoul/POM01MKII/1122one-mk2.csh
>
> It works good.
> It's doesn't work only when it is in crontab.
>
> Other shell files that doesn't contain any IDL code work without any
> problem.
>
> How can I solve this problem? T.T

Is it
1- a license issue?
2- an X issue?

Those would be my first guesses.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How can i put in a IDLgrAxis non constant values ?
Next Topic: int_2D and int_3D

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:15:51 PDT 2025

Total time taken to generate the page: 0.00519 seconds