免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3332 | 回复: 4
打印 上一主题 下一主题

用crontab实现oracle自动备份,crontab里的任务老是无法执行 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-03-03 15:07 |只看该作者 |倒序浏览
我直接执行脚本的时候没有问题.
bash-3.00$ crontab -l
30 14 * * * /export/home/oracle/bakDB.sh

日志文件如下:
bash-3.00# tail -f /var/cron/log
could not obtain latest contract from popen(3C): 无此进程 六  3月  3 11:00:00 2007
bash-3.00$ tail -f /usr/mail/oracle
/bakDB.sh: line 9: exp: command not found
/bakDB.sh: line 10: exp: command not found
        zip warning: name not matched: *

zip error: Nothing to do! (bak0703031430.zip)
*.zip: No such file or directory
Hash mark printing on (8192 bytes/hash mark).
mv: cannot access *

希望斑竹帮帮忙

[ 本帖最后由 brucebo 于 2007-3-3 15:09 编辑 ]

论坛徽章:
0
2 [报告]
发表于 2007-07-13 15:43 |只看该作者
30  14  * * *  /bin/sh  /export/home/oracle/bakDB.sh

论坛徽章:
0
3 [报告]
发表于 2007-07-13 16:29 |只看该作者
I think you'd better declare some vital env variables in your script.

论坛徽章:
0
4 [报告]
发表于 2007-07-13 22:27 |只看该作者
could not obtain latest contract from popen(3C): 无此进程 六  3月  3 11:00:00 2007
Is your Solaris version 10 u1? (cat /etc/release will tell you). If so, this is a bug and it is fixed in s10u3.
/bakDB.sh: line 9: exp: command not found
/bakDB.sh: line 10: exp: command not found
cron job doesn't run through a terminal. The environment variables in your profile will not be read. So you should explicitly source your profile in your backDB.sh file and/or use absolute path for the exp command

[ 本帖最后由 briangao 于 2007-7-13 09:34 编辑 ]

论坛徽章:
4
技术图书徽章
日期:2013-09-23 10:22:37狮子座
日期:2013-10-15 23:31:54卯兔
日期:2013-11-11 17:33:15金牛座
日期:2013-11-15 17:25:28
5 [报告]
发表于 2007-07-14 00:19 |只看该作者
我在几架测试机都是每天跑exp备份的
你的ORACLE_HOME ORACLE_SID PATH LD_LIBRARY_PATH都要设好
可能也需要设NLS_LANG
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP