新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
crontab不運行-創(chuàng)新互聯(lián)
[ora
*/5 * * * * sh /tmp/delete.sh
*/5 * * * * /tmp/delete.sh
5 * * * * sh /tmp/delete.sh
5 * * * * /tmp/delete.sh
05 * * * * sh /tmp/delete.sh
05 * * * * /tmp/delete.sh
5 * * * * /tmp/delete.sh
5 * * * * sh /tmp/delete.sh
[oracle@tdsogg tmp]$ ls /tmp/delete.sh
/tmp/delete.sh
[oracle@tdsogg tmp]$ cat /tmp/delete.sh
#!/bin/bash
DELETE_SCRIPT=/tmp/delete_script.sql
GET_DELETE_SQL=/tmp/get_delete_sql.sql
export DELETE_SCRIPT
export GET_DELETE_SQL
rm -rf "$DELETE_SCRIPT"
export ORACLE_SID=tdsogg
sqlplus " / as sysdba" @$GET_DELETE_SQL
chmod 775 $DELETE_SCRIPT
RMAN_LOG_FILE=/tmp/delete_log_`date +%Y%m%d_%H%M%S`.out
rman target / nocatalog msglog $RMAN_LOG_FILE @$DELETE_SCRIPT
查看日志也沒有收獲
而手工 sh delete.sh 卻可以運行
應(yīng)該是環(huán)境變量引起的
cat .bash_profile
將
PATH=$PATH:$HOME/bin
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin
加到delete.sh 代碼中,后運行正常
網(wǎng)站名稱:crontab不運行-創(chuàng)新互聯(lián)
分享URL:http://www.ef60e0e.cn/article/djccde.html
*/5 * * * * sh /tmp/delete.sh
*/5 * * * * /tmp/delete.sh
5 * * * * sh /tmp/delete.sh
5 * * * * /tmp/delete.sh
05 * * * * sh /tmp/delete.sh
05 * * * * /tmp/delete.sh
5 * * * * /tmp/delete.sh
5 * * * * sh /tmp/delete.sh
[oracle@tdsogg tmp]$ ls /tmp/delete.sh
/tmp/delete.sh
[oracle@tdsogg tmp]$ cat /tmp/delete.sh
#!/bin/bash
DELETE_SCRIPT=/tmp/delete_script.sql
GET_DELETE_SQL=/tmp/get_delete_sql.sql
export DELETE_SCRIPT
export GET_DELETE_SQL
rm -rf "$DELETE_SCRIPT"
export ORACLE_SID=tdsogg
sqlplus " / as sysdba" @$GET_DELETE_SQL
chmod 775 $DELETE_SCRIPT
RMAN_LOG_FILE=/tmp/delete_log_`date +%Y%m%d_%H%M%S`.out
rman target / nocatalog msglog $RMAN_LOG_FILE @$DELETE_SCRIPT
查看日志也沒有收獲
而手工 sh delete.sh 卻可以運行
應(yīng)該是環(huán)境變量引起的
cat .bash_profile
將
PATH=$PATH:$HOME/bin
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export PATH=$PATH:$ORACLE_HOME/bin
加到delete.sh 代碼中,后運行正常
網(wǎng)站名稱:crontab不運行-創(chuàng)新互聯(lián)
分享URL:http://www.ef60e0e.cn/article/djccde.html