Script Works, But Not with CRON

Bob Stockler bob at trebor.iglou.com
Tue May 4 08:06:00 PDT 2004


The following script works _perfectly_ when excuted from
the command line, but fails when run by 'cron'.

I added the statements "STATUS=${STATUS}$?" after each
filePro command to capture the exit values of each one,
and it returns "STATUS=101011" in email to me.  That
indicates all of the filePro commands except the "ddir"
one are failing.

No other filePro processes are running when this is run.

What am I overlooking?

------------------------------ cut here ----------------------------
#!/bin/sh
TERM=ansi ; PFTERM=ansi ; PFPROG=/u/appl ; PFDATA=/u ; PFDIR=""
REPORT=$PFPROG/fp/dreport
DDIR=$PFPROG/fp/ddir ; DXMAINT=$PFPROG/fp/dxmaint
export TERM PFTERM PFPROG PFDATA PFDIR REPORT DDIR DXMAINT

STATUS=""
$REPORT invtry -f zip -y '' -z last12 -a -u >/dev/null 2>&1
STATUS=${STATUS}$?  # 1

for fPfile in invtry invitm
do $DDIR $fPfile -L >/dev/null 2>&1        ; STATUS=${STATUS}$?  # 2 & 4
   $DXMAINT $fPfile -ra -e >/dev/null 2>&1 ; STATUS=${STATUS}$?  # 3 & 5
done

$REPORT invitm -f zip -y '' -z '' -v last12 -id -a -u >/dev/null 2>&1
STATUS=${STATUS}$?  # 6 

case $STATUS in
  000000) : ;;
       *) echo "Program Failed - STATUS=$STATUS" | \
          mail -s "CRON Script" bob at trebor.iglou.com ;;
esac
exit 0
------------------------------ cut here ----------------------------

Bob

-- 
Bob Stockler - bob at trebor.iglou.com
Author: MENU EDIT II - The BEST Creator/Editor/Manager for filePro User Menus.
Fully functional (time-limited) demos available by email request (specify OS).


More information about the Filepro-list mailing list