在/opt/oracle/backup/backupdb.sh中
#! /bin/sh
APP_NAME=`date +%y%m%d%H%M`
cd /opt/oracle/backup/data
echo $APP_NAME >/opt/oracle/backup/logs/messagedate.log
ORACLE_HOME=/opt/oracle/OraHome
export ORACLE_HOME
ORACLE_SID=insight
export ORACLE_SID
cd /opt/oracle/backup/data/
$ORACLE_HOME/bin/expdp appraise/appraise schemas=appraise dumpfile=db165_appraise_$APP_NAME.dmp DIRECTORY=dpump_dir
在crontab -e中
0 */6 * * * /opt/oracle/backup/backup.sh >/opt/oracle/backup/logs/errorcron.log