Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: CRONTAB JOB

Re: CRONTAB JOB

From: <Brian_P_MacLean_at_eFunds.Com>
Date: Fri, 15 Mar 2002 14:13:26 -0800
Message-ID: <F001.0042B1B7.20020315141326@fatcity.com>

(What everybody else said plus)

If you have root access (or get your sa to), vi /var/cron/log and look for your job.

Under some situations cron will mail you a message and/or job output to you, so check your unix mail.

The script template below should work (change as required). It's very very basic but should do the job. Don't forget to make the script executable with "chmod +x backup.ksh":

#!/bin/ksh
#
# Name: backup.ksh
#

DAYTIME=$(date +"%Y%m%d_%H%M")
JOB_LOG=/tmp/backup.log.${DAYTIME}
exec 1>${JOB_LOG} 2>&1
echo "#\n#Starting ${0##*/} at $(date)\n#" export ORACLE_HOME=/oracle/apps/oracle/8.1.5 export ORACLE_SID=MYDB
export PATH=${PATH}:${ORACLE_HOME}/bin
sqlplus /nolog <<EOF
  connect system/manager
  @/path/to/my/script/first_script.sql
  @/path/to/my/script/second_script.sql
  exit;
EOF
echo "#\n#Ending ${0##*/} at $(date)\n#" mailx -s "${0##*/}:$(uname -n):${ORACLE_SID}:$(date)" my_email_address_at_mycompany.com < ${JOB_LOG}
#
# END-OF-SCRIPT
###############################################################################################




                                                                                                               
                    Hamid Alavi                                                                                
                    <hamid.alavi_at_qu       To:     Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>  
                    ovadx.com>            cc:                                                                  
                    Sent by:              Subject:     CRONTAB JOB                                             
                    root_at_fatcity.co                                                                            
                    m                                                                                          
                                                                                                               
                                                                                                               
                    03/15/02 09:28                                                                             
                    AM                                                                                         
                    Please respond                                                                             
                    to ORACLE-L                                                                                
                                                                                                               
                                                                                                               




Hi All,

I have a crontab job but this job never started, I have no idea what's wrong, actualy i am not a unix person, here is the job: cron job name is : qqad.cron
04 17 * * 1-5 /opt/qqad/sql/QQAD_backupscript.sh and here is the QQAD_backupscript.sh (in /opt/qqad/sql)

sqlplus system/manager_at_QQAD @COLD_BAKUP_FOR_QQADha.SQL; cold_back.sql is
generated by COLD_BAKUP_FOR_QQADha.SQL

@/opt/qqad/sql/cold_back.sql;

If I run the job manualy it is going OK but crontab never start. Any Idea??

Hamid Alavi
Office 818 737-0526
Cell 818 402-1987

The information contained in this message and any attachments is intended only for the use of the individual or entity to which it is addressed, and may contain information that is PRIVILEGED, CONFIDENTIAL and exempt from disclosure under applicable law. If you have received this message in error,
you are prohibited from copying, distributing, or using the information. Please contact the sender immediately by return e-mail and delete the original message from your system.

--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Hamid Alavi
  INET: hamid.alavi_at_quovadx.com

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: ListGuru_at_fatcity.com (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: INET: Brian_P_MacLean_at_eFunds.Com 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: ListGuru_at_fatcity.com (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).
Received on Fri Mar 15 2002 - 16:13:26 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US