Daily Checks

Hey Guys,

I'm seeking some assistance in getting this script to run as a cron job for the user oracle.. the script is basically to perform 2 ADRCI checks... see the script below... i'm getting the following error: /export/home/oracle/Daily_Checks/ADRCI_Daily_Checks.sh: syntax error at line 16: `HOSTNAME=$' unexpected

#
SUBJECT="Daily-Checks"
EMAIL="#########"
BODY="output.txt"
#
#
echo +----------------------------------------------------------------------------------------------------------+ >> $BODY
echo +----------------------------------------------------------------------------------------------------------+ >> $BODY
#
#
echo This is the date of this Daily Check >> $BODY
echo PDBS02 - Database Server 2 >> $BODY
date >> $BODY
#
echo ----------------------------------------------------------------------------------- >> $BODY
echo  >> $BODY
#
#
cd /export/home/oracle
. ./envptnt2
echo " SHOW PROBLEM; SHOW INCIDENT " >> $BODY
echo ----------------------------------------------------------------------------------- >> $BODY
echo  >> $BODY
#
adrci EXEC="SHOW PROBLEM; SHOW INCIDENT" >> $BODY
#
#
echo >> $BODY
echo ----------------------------------------------------------------------------------- >> $BODY
echo  >> $BODY
#
#
#
###########################################################################
#                       Email Output files to RMS                         #
###########################################################################
#
#
mail -s "Daily Checks DB" $EMAIL < $BODY
#
#
sleep 10
###########################################################################
#                       Remove Output file                                #
###########################################################################
#
#
rm -rf /export/home/oracle/output.txt
rm -rf /export/home/oracle/Daily_Checks/output.txt

Thanks for the help...

If that is you whole script then:

. ./envptnt2   #  <-  the error is in this script

how do i set the environment then?... the script works perfectly fine when i execute it, but when i run it as a cron job it throws the error...

missing an echo on line 8 :

echo +----------------------------------------------------------------------------------------------------------+ >> $BODY

Check program for DOS ^M characters... try dos2unix ADRCI_Daily_Checks.sh

that was my mistake copying and pasting it here lol... i had to remove some sensitive data out that I echo into the output e-mail.

bump...

---------- Post updated at 05:20 PM ---------- Previous update was at 05:17 PM ----------

copy and paste bro... that's not there in the script...

If that's not in your script, could you post what is in your script?

i had to remove some "sensitive" data out of it... so there are a few minor mistakes...