[英]crontab can not running python script
I use centOS, at command line, I execute >./tv.py
script and it runs correctly. 我使用centOS,在命令行中执行
>./tv.py
脚本,它可以正确运行。
But, when I include into /etc/crontab
, entry */30 * * * * /root/tv.py
, it does not. 但是,当我在
/etc/crontab
包含条目*/30 * * * * /root/tv.py
,它没有。
What am I doing wrong? 我究竟做错了什么?
This is the head of script: 这是脚本的头:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from bs4 import BeautifulSoup
We need more information to troubleshoot this issue. 我们需要更多信息来解决此问题。 Namely, you will need to monitor /var/log/syslog and spot errors regarding that cronjob.
即,您将需要监视/ var / log / syslog并发现有关该cronjob的错误。 It is probably also good practice to output an error log for this job.
为该作业输出错误日志也是一种很好的做法。
我只是将crontab更改为*/30 * * * * root python /root/tv.py
,然后运行,谢谢大家。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.