Daily Checks


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Daily Checks
# 1  
Old 02-14-2012
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

Code:
#
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...


Moderator's Comments:
Mod Comment Please use code tags
for your code and data!

Last edited by Racegod; 02-14-2012 at 06:46 PM..
# 2  
Old 02-14-2012
If that is you whole script then:
Code:
. ./envptnt2   #  <-  the error is in this script

# 3  
Old 02-14-2012
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...
# 4  
Old 02-14-2012
missing an echo on line 8 :
Code:
echo +----------------------------------------------------------------------------------------------------------+ >> $BODY

Check program for DOS ^M characters... try dos2unix ADRCI_Daily_Checks.sh
# 5  
Old 02-14-2012
Quote:
Originally Posted by Chubler_XL
missing an echo on line 8 :
Code:
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.
# 6  
Old 02-16-2012
bump...

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

Quote:
Originally Posted by jim mcnamara
If that is you whole script then:
Code:
. ./envptnt2   #  <-  the error is in this script

copy and paste bro... that's not there in the script...
# 7  
Old 02-16-2012
If that's not in your script, could you post what is in your script?
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Want to automate some DNS checks

I'd like to automate some common DNS checks that I do regularly. I do tech support, part of my job being to walk customers through setting up various DNS records, including SPF and DKIM. Most of these customers are small to medium sized businesses. The first part of the call is always me doing some... (6 Replies)
Discussion started by: pica
6 Replies

2. Shell Programming and Scripting

Script to do the following checks

Hi , I need a script for processing below scenario. I have to check daily by doing ftp IP to check it is logging or not. So i want this activity to be automated such that if login succesful i will get "FTP LOGIN SUCCESS" in a log file and if fails i want the error message in the same log... (1 Reply)
Discussion started by: sv0081493
1 Replies

3. Shell Programming and Scripting

Script to performs checks

Hi , I need a script which performs below activity I have one file named "testfile" in 9 different directories with same name. I want to perform below action with each testfile of each directory. if ; then mv listfiles listfiles_`date +%b%y` else echo No Such files fi ... (4 Replies)
Discussion started by: sv0081493
4 Replies

4. UNIX for Dummies Questions & Answers

Daily File Checks

Hello all, I'm sorry if this is answered elsewhere, I've used the search function and can't find the specifics of what I'm after. I am brand new to playing with linux, and ideally I want to get better to help the company that I now work for. What I want to do: Create a script that I... (4 Replies)
Discussion started by: Aussiemick
4 Replies

5. Shell Programming and Scripting

Parameter checks -

Another stupid question. Why does this work on our Solaris box but not on our much newer red hat box... if then echo "running in test" else echo "running in live" I assume I am missing something between the . Any help is of course greatly appreciated. (2 Replies)
Discussion started by: mcclunyboy
2 Replies

6. AIX

Daily checks for AIX business critical boxes.

Hi all, I will like to know what are all sanitary checks which should be done on daily basis on all business critical AIX boxes without fail. (7 Replies)
Discussion started by: deepm
7 Replies

7. AIX

Pre-checks

AIX Guys!!! What pre-checks would you do on a 5.3 server before TL/SP/APAR installation? Bala (2 Replies)
Discussion started by: balaji_prk
2 Replies

8. UNIX for Advanced & Expert Users

Doing Checks on a file

I have a process that I am trying to provide a solution for and have hit a brick wall and would like some pointers in the right direction. Basically on a daily basis a report is automatically generated in a CSV format (FIRST.CSV) which includes codes and amounts in the following format: ... (6 Replies)
Discussion started by: SAMZ
6 Replies

9. UNIX for Dummies Questions & Answers

health checks

Hello Anyone please help me with a health check script on HP-UX. (1 Reply)
Discussion started by: mahlathini
1 Replies
Login or Register to Ask a Question