【发布时间】:2021-01-14 23:57:26
【问题描述】:
我有一个运行的 sh 文件:python -m grafana_backup.cli save --config $settings_file。
我从 crontab 运行此文件,运行 .sh 文件,但出现此错误:python: command not found。
crontab 中的 shell 是 SHELL=/bin/bash,.sh 文件中的 shell 是 #!/bin/bash
【问题讨论】:
-
您是否使用某种虚拟环境来运行python?如果是这样,您可能希望在调用 python 之前在 shell 脚本中获取激活脚本。
-
行得通!就是这个问题,谢谢。