Yawn... -----Original Message----- Sent: Tuesday, April 16, 2002 10:08 AM To: Multiple recipients of list ORACLE-L
I have this unix script, please tell me how to change it so it also does the following: counts the time between start time and end time of the process(I mean time difference between Jobb startat(Job started) and Job Klart(Job Finished). loadbilbo.sh: #!/bin/sh . /usr/bin/orasetup.sh . /d31/appl/konto/bat/movefiles.sh echo "Jobb startat :\c" >/d31/appl/konto/log/laddabilbo.txt date >>/d31/appl/konto/log/laddabilbo.txt sqlldr userid=konto/icakort control=/d31/appl/konto/bat/ehbgrupp.ctl log=/d31/appl/konto/log/ehbgrupp.log sqlldr userid=konto/icakort control=/d31/appl/konto/bat/kampanj.ctl log=/d31/appl/konto/log/kampanj.log sqlldr userid=konto/icakort control=/d31/appl/konto/bat/mxurval.ctl log=/d31/appl/konto/log/mxurval.log sqlldr userid=konto/icakort control=/d31/appl/konto/bat/load_arg.ctl log=/d31/appl/konto/log/load_arg.log sqlldr userid=konto/icakort control=/d31/appl/konto/bat/laddabsg.ctl log=/d31/appl/konto/log/laddabsg.log sqlplus -s konto/icakort << ! set heading off set verify off set feedback off set termout off set pages 0 begin konto.fillbilbotables.anrop; END; / EXIT ! echo "------------------------------------------------------" >>/d31/appl/konto/log/laddabilbo.txt echo "ehbgrupp status ">>/d31/appl/konto/log/laddabilbo.txt tail -11 /d31/appl/konto/log/ehbgrupp.log >>/d31/appl/konto/log/laddabilbo.txt echo "------------------------------------------------------" >>/d31/appl/konto/log/laddabilbo.txt echo "------------------------------------------------------" >>/d31/appl/konto/log/laddabilbo.txt echo "kampanj status ">>/d31/appl/konto/log/laddabilbo.txt tail -11 /d31/appl/konto/log/kampanj.log >>/d31/appl/konto/log/laddabilbo.txt echo "------------------------------------------------------" >>/d31/appl/konto/log/laddabilbo.txt echo "------------------------------------------------------" >>/d31/appl/konto/log/laddabilbo.txt echo "mxurval status ">>/d31/appl/konto/log/laddabilbo.txt tail -11 /d31/appl/konto/log/mxurval.log >>/d31/appl/konto/log/laddabilbo.txt echo "------------------------------------------------------" >>/d31/appl/konto/log/laddabilbo.txt echo "------------------------------------------------------" >>/d31/appl/konto/log/laddabilbo.txt echo "load_arg status ">>/d31/appl/konto/log/laddabilbo.txt tail -11 /d31/appl/konto/log/load_arg.log >>/d31/appl/konto/log/laddabilbo.txt echo "------------------------------------------------------" >>/d31/appl/konto/log/laddabilbo.txt echo "------------------------------------------------------" >>/d31/appl/konto/log/laddabilbo.txt echo "laddabsg status ">>/d31/appl/konto/log/laddabilbo.txt tail -11 /d31/appl/konto/log/laddabsg.log >>/d31/appl/konto/log/laddabilbo.txt echo "------------------------------------------------------" >>/d31/appl/konto/log/laddabilbo.txt echo "Jobb klart! :\c" >>/d31/appl/konto/log/laddabilbo.txt date >>/d31/appl/konto/log/laddabilbo.txt cat /d31/appl/konto/log/laddabilbo.txt | mailx -s "Konto - Statusrapport" [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED] IThis log file is also sent by mail to people. I would like this log file only to be sent if there is anything wrong with the script(for instance if the database is down) So if the script goes fine, then no email will be sent. The log file looks like this: Jobb startat :Sun Apr 14 18:06:23 MEST 2002 ------------------------------------------------------ ehbgrupp status Total logical records skipped: 0 Total logical records read: 400 Total logical records rejected: 0 Total logical records discarded: 0 Run began on Sun Apr 14 18:06:23 2002 Run ended on Sun Apr 14 18:11:51 2002 Elapsed time was: 00:05:28.15 CPU time was: 00:00:00.07 (Ma ------------------------------------------------------ ------------------------------------------------------ kampanj status Total logical records skipped: 0 Total logical records read: 13 Total logical records rejected: 0 Total logical records discarded: 0 Run began on Sun Apr 14 18:11:51 2002 Run ended on Sun Apr 14 18:12:44 2002 Elapsed time was: 00:00:52.52 CPU time was: 00:00:00.04 (Ma ------------------------------------------------------ ------------------------------------------------------ mxurval status Total logical records skipped: 0 Total logical records read: 4829 Total logical records rejected: 0 Total logical records discarded: 0 Run began on Sun Apr 14 18:12:44 2002 Run ended on Sun Apr 14 18:12:50 2002 Elapsed time was: 00:00:05.90 CPU time was: 00:00:00.18 (Ma ------------------------------------------------------ ------------------------------------------------------ load_arg status Total logical records skipped: 0 Total logical records read: 151613 Total logical records rejected: 0 Total logical records discarded: 0 Run began on Sun Apr 14 18:12:50 2002 Run ended on Sun Apr 14 18:28:11 2002 Elapsed time was: 00:15:20.92 CPU time was: 00:00:25.07 (Ma ------------------------------------------------------ ------------------------------------------------------ laddabsg status Total logical records skipped: 0 Total logical records read: 92326 Total logical records rejected: 0 Total logical records discarded: 0 Run began on Sun Apr 14 18:28:11 2002 Run ended on Sun Apr 14 18:40:15 2002 Elapsed time was: 00:12:03.95 CPU time was: 00:00:32.17 (Ma ------------------------------------------------------ Jobb klart! :Sun Apr 14 18:49:23 MEST 2002 I would really appreciate help. Thanks in advance Roland -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Grabowy, Chris INET: [EMAIL PROTECTED] Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051 San Diego, California -- Public Internet access / Mailing Lists -------------------------------------------------------------------- To REMOVE yourself from this mailing list, send an E-Mail message to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing).
