【发布时间】:2018-01-26 08:55:36
【问题描述】:
我正在尝试运行以下 bash 脚本,该脚本在激活 conda 环境后运行 Python 程序。
send.bash
#!/bin/bash
source activate manage_oam_users
python ~/path/to/script/send.py
source deactivate
crontab
30 * * * * source /path/to/script/send.bash
我从 cron 收到以下错误,尽管运行 source send.bash 可以完美运行。我也尝试过使用bash send.bash,它在手动运行时工作正常,但在从 cron 运行时会导致相同的错误。
/path/to/script/send.bash: line 2: activate: No such file or directory
【问题讨论】:
标签: python bash shell cron anaconda