问题描述:
需求…不在描述。
shell 脚本名 /home/abc/test.sh
#!/bin/bash
...
python test.py
...
执行权限已经赋予
crontab -l
20 6 * * * /home/abc/test.sh
无法执行脚本中的python命令,然而手动可以执行。
问题原因:
crontab 不会加载path环境变量,所以手动的加载。
解决办法:
#!/bin/bash
...
/home/abc/anaconda3/bin/python test.py
...