[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

20000606: McIDAS batch file won't run from crontab (cont.)



>From: Gilbert Sebenste <address@hidden>
>Organization: NIU
>Keywords: 200006031813.e53IDIT00341 McIDAS-X shell script

Gilbert,

re: put McIDAS commands into a BATCH file and run the batch file from
    a generalized Unix shell script:

#!/bin/sh -f
MCHOME=/home/mcidas
MCDATA=$MCHOME/workdata
MCLOG=$MCDATA/scour.log
MCPATH=${MCDATA}:$MCHOME/data:$MCHOME/help
PATH=$MCHOME/bin:$PATH
exec 2>$MCLOG 1>&2
LD_LIBRARY_PATH=/usr/local/lib:/lib:$MCHOME/lib:/usr/lib
cd $MCDATA
MCPATH=$MCPATH PATH=$PATH LD_LIBRARY_PATH=$LD_LIBRARY_PATH mcenv << EOF
batch.k $1
exit
EOF
exit 0

This would be executed like:

chmod +x mcbatch.sh
mcbatch.sh CFDG.BAT

>This does not work. I don't even get an error message. When I run it
>manually, I get that stty: ioctl type-error that I told you about
>earlier.

OK, I need the exact error message.  The error you told me about in
a previous email was an 'unexpected end of script in line 83'.  If
you reworked the script, you should not be getting this anymore.

I made one change to the Unix shell script I sent you earlier and it
ran fine here at the UPC.  The change was to replace 'EOF' with EOF.
The other thing to check is the exact location of sh on your system.  I
was assuming that you are running on RedHat 6.1 Linux, and on that OS
sh is located in /bin.

>I don't even get a message in an eror log. I ran it manually.

I am betting that you have some sort of typo.

re: start using FRMSAVE instead of SVGIF
>OK.

re: running EU twice to try and make sure that the enhancement is
correctly restored on a system running in 24-bit mode.

>Yes...

>Cool. But it still doesn't work. :-(

Which doesn't work?  Are you still referring to the BATCH/Unix shell script
invocation?  If so, try the mod above to the shell script; if not, then
I am assuming you are referring to the enhancement not being restored;
true?

Tom

>From address@hidden Tue Jun  6 19:41:57 2000
>Subject: Re: 20000606: McIDAS batch file won't run from crontab (cont.)

Tom,

>> #!/bin/sh -f
>> MCHOME=/home/mcidas
>> MCDATA=$MCHOME/workdata
>> MCLOG=$MCDATA/scour.log
>> MCPATH=${MCDATA}:$MCHOME/data:$MCHOME/help
>> PATH=$MCHOME/bin:$PATH
>> exec 2>$MCLOG 1>&2
>> LD_LIBRARY_PATH=/usr/local/lib:/lib:$MCHOME/lib:/usr/lib
>> cd $MCDATA
>> MCPATH=$MCPATH PATH=$PATH LD_LIBRARY_PATH=$LD_LIBRARY_PATH mcenv << EOF
>> batch.k $1
>> exit
>> EOF
>> exit 0
>> 
>> This would be executed like:
>> 
>> chmod +x mcbatch.sh
>> mcbatch.sh CFDG.BAT

>Yep. That's what i am doing, out of cron.
 
>Yes it is. And when I run it manually, it now works! (I'm using RH Linux
>6.2, BTW). BUT...butbutbutbutbut, when I run it from cron, no images are
>made, and this is what happens:

---------- Forwarded message ----------
Date: Tue, 6 Jun 2000 20:36:00 -0500
From: Cron Daemon <address@hidden>
To: address@hidden
Subject: Cron <mcidas@weather> /home/mcidas/kickoff CFDG3.BAT

>SF 1
>EG 1
>Erased graphic frame(s) 1-1
>EG I 1
>Erased image frame(s) 1-1
>EU REST IMAGE2
>EU: Restoring IMAGE2.ET    to frame(s)=   1
>EU: Done
>EU REST IMAGE2
>EU: Restoring IMAGE2.ET    to frame(s)=   1
>EU: Done
>GU MAKE 2 50 0 0
>GU: Done
>IMGDISP RTGINI/GE1KVIS STA=EAR 1 WID=9
>IMGDISP: Image data server unable to resolve this dataset: RTGINI/GE1KVIS
>IMGDISP: done
>IMGDISP failed, RC=2
>batch.k: BATCH job abandon /home/mcidas/workdata/CFDG3.BAT
>batch.k: BATCH done /home/mcidas/workdata/CFDG3.BAT

>> I am betting that you have some sort of typo.

>The 'EOF' is now taken care of. But what's this????
 
>Sorry I didn't clarify the last part. Yes, the double lines of "EU
>REST" do work. But this script doesn't. It souns like it's missing a path,
>but here is the script, verbatim:

>#!/bin/sh -f
>MCHOME=/home/mcidas
>MCDATA=$MCHOME/workdata
>MCLOG=$MCDATA/scour.log
>MCPATH=${MCDATA}:$MCHOME/data:$MCHOME/help
>PATH=$MCHOME/bin:$PATH
>#exec 2>$MCLOG 1>&2
>LD_LIBRARY_PATH=/usr/local/lib:/lib:$MCHOME/lib:/usr/lib
>cd $MCDATA
>MCPATH=$MCPATH PATH=$PATH LD_LIBRARY_PATH=$LD_LIBRARY_PATH mcenv << EOF
>batch.k $1
>exit
>EOF
>exit 0

>And the script I use is the one you gave me, verbatim. Again all this
>works when I run it "manually", but when I run it from cron, it bombs with
>the error message above. It almost looks like it's missing or can't find a
>path to something, but I dunno what it is.

>From address@hidden Tue Jun  6 19:42:22 2000

>And...as always...thanks for all your help! This is weird. But once it
>works, it will be VERY cool!

From: support

Gilbert's setup is such that there is no MCTABLE.TXT file in ~mcidas/workdata.
All of his DATALOCs are in ~mcidas/data/ADDESITE.TXT.  Because of this,
he needed to add a definition for MCTABLE_READ to his shell script in
the form:

MCTABLE_READ="${MCDATA}/MCTABLE.TXT;${MCHOME}/data/ADDESITE.TXT"

export MCHOME MCDATA MCPATH PATH LD_LIBRARY_PATH MCTABLE_READ

>From address@hidden Wed Jun  7 08:51:36 2000
>Subject: McIDAS script still not working

Hi Tom,

>Although I deserve the death penalty for this, I did my best to write down
>what you said this morning, but I had a phone call as well. Bottom line, I
>think I got the gist of what you were saying, and I think I did this
>right, but the "kickoff" script still causes the same error as
>yesterday, that it can't apparently find ADDESITE.TXT. Look at the line I
>added (MCTABLE_READ). Is this right?

>#!/bin/sh -f
>MCHOME=/home/mcidas
>MCDATA=$MCHOME/workdata
>MCLOG=$MCDATA/scour.log
>MCPATH=${MCDATA}:$MCHOME/data:$MCHOME/help
>PATH=$MCHOME/bin:$PATH
>MCTABLE_READ=${MCDATA}/mctable.txt:${MCHOME}/data/ADDESITE.TXT
>#exec 2>$MCLOG 1>&2
>LD_LIBRARY_PATH=/usr/local/lib:/lib:$MCHOME/lib:/usr/lib
>cd $MCDATA
>MCPATH=$MCPATH PATH=$PATH LD_LIBRARY_PATH=$LD_LIBRARY_PATH mcenv << EOF
>batch.k $1
>exit
>EOF
>exit 0

The problem in the above script is the syntax of MCTABLE_READ.  It
should be:

-- possible problem: MCTABLE_READ definition when including
${MCDATA}/MCTABLE.TXT, which doesn't exist) fails; will have to check this
out! --

MCTABLE_READ="${MCHOME}/data/ADDESITE.TXT"

The problems were:

o no '"' (shifted quotes)
o improper separator ':' (colon) instead of ';' (semi-colon)
o not a problem, but I think he wanted 'MCTABLE.TXT' instead of 'mctable.txt'
o MCTABLE_READ was not exported