[ora
专业成都网站建设公司,做排名好的好网站,排在同行前面,为您带来客户和效益!
创新互联建站为您提供成都网站建设,五站合一网站设计制作,服务好的网站设计公司,
成都网站制作、成都网站设计负责任的成都网站制作公司!cle@tdsogg tmp]$ crontab -l
*/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 却可以运行
应该是环境变量引起的
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 代码中,后运行正常
文章题目:crontab不运行-创新互联
链接分享:
http://bjjierui.cn/article/djccde.html