关于网友提出的“python脚本单独运行没有问题 但是在CENTOS下crontab定时执行报错”问题疑问,本网通过在网上对“python脚本单独运行没有问题 但是在CENTOS下crontab定时执行报错”有关的相关答案进行了整理,供用户进行参考,详细问题解答如下:
问题:python脚本单独运行没有问题 但是在CENTOS下crontab定时执行报错
描述:Traceback (most recent call last):
File "/root/Daigou/qunarOrder/tools/flightAlterationScript.py", line 58, in main
self.needCallflight(self.comparedata(searchDate))
File "/root/Daigou/qunarOrder/tools/flightAlterationScript.py", line 266, in comparedata
traceback.print_exc()
File "/usr/lib64/python2.6/traceback.py", line 233, in print_exc
print_exception(etype, value, tb, limit, file)
File "/usr/lib64/python2.6/traceback.py", line 124, in print_exception
_print(file, 'Traceback (most recent call last):')
File "/usr/lib64/python2.6/traceback.py", line 13, in _print
file.write(str+terminator)
IiOError: [Errno 32] Broken pipe 日志如上
解决方案1: root账户下执行crontab -l看一下有没有。
解决方案2:看个起来像是日志文件权限的问题。
以上介绍了“python脚本单独运行没有问题 但是在CENTOS下crontab定时执行报错”的问题解答,希望对有需要的网友有所帮助。
本文网址链接:http://www.codes51.com/itwd/1427470.html