我试图用以下代码向crontab添加一个python脚本:
0 * * * * /pathtoexecutable/file.py
0 0 1 * 1 /pathtoexecutable/file2.py
文件是可执行的python脚本。在
file.py
进一步启动大约15个子进程,这些子进程将信息存储在MySQL数据库中。在
file2.py
显然也通过crontab执行。在
由于某些原因,file.py
不能通过crontab工作,但如果我通过命令行运行它,它就可以工作了。在
Tags:
1)捕获脚本的输出和错误:。在
2)确保每个python文件都以shebang开头:#!/usr/bin/env python
请确保python exec x的每个文件.py)在
相关问题 更多 >
编程相关推荐