我有debian linux。我从用户创建了crontab -e
这个文本:
0 * * * * python /home/user/CronLogic.py
15 * * * * python /home/user/CronLogic.py
30 * * * * python /home/user/CronLogic.py
45 * * * * python /home/user/CronLogic.py
*/1 * * * * date > /tmp/TEST
最后一个字符串运行良好,但运行 python 脚本失败:
/bin/sh: 1: /usr/bin/rcssserver: not found
代码是:
#!/usr/bin/python
cmd ='/usr/bin/rcssserver'
err = open('CronLogicERRORS', 'a')
server = subprocess.Popen(cmdRes, shell=True, stderr=err)
并且错误出现在CronLogicERRORS
文件中。这里有什么问题?没有 cron 脚本运行良好。