首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > UNIXLINUX >

crontab运行shell失败解决方法

2012-04-05 
crontab运行shell失败系统是红旗linux的,在crontab中加入30 21 * * * /app/test/ncup/sbin/test.sh其中tes

crontab运行shell失败
系统是红旗linux的,在crontab中加入
30 21 * * * /app/test/ncup/sbin/test.sh
其中test.sh脚本中开头是这样的
#!/usr/bin/ksh
#$1 txn_dt
cd /app/test
. .bash_profile
之后就是具体的处理逻辑。
查看/var/log/log/cron,发现
Dec 29 21:30:01 localhost crond[32366]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Dec 29 21:30:01 localhost crond[32367]: (test) CMD (/app/test/ncup/sbin/test.sh)
Dec 29 21:35:01 localhost crond[32384]: (root) CMD (/usr/bin/mrtg /etc/mrtg/mrtg.cfg --lock-file /var/lock/mrtg/mrtg_l --confcache-file /var/lib/mrtg/mrtg.ok)
有这样的日志,应该是已经执行到脚本了,但是脚本却没有执行起来(脚本单独执行是没有问题的),这是为什么?

[解决办法]

Assembly code
#!/usr/bin/ksh#$1 txn_dtcd /app/test. /etc/profile. .bash_profile
[解决办法]
探讨
? 公有云和私有云有哪些不同?? Hadoop和云计算有什么关系?? 什么是GTI云安全架构?? Google公司的云计算服务有哪些?? 云服务模式:SaaS、PaaS和IaaS...系统是红旗linux的,在crontab中加入
30 21 * * * /app/test/ncup/sbin/test.sh
其中test.sh脚本中开头是这样的
#!/usr/bin/ksh
#$1 tx……

热点排行
Bad Request.