Cron: Setting PATH from shell script not working
This question already has an answer here:
A cron
job runs in the owner's home directory, so that's what pwd
results in when it runs. Just put the directory you want instead.
PATH=$PATH:/vagrant
Incidentally, you can't (reliably) use the Bash syntax export variable=value
because Cron runs plain sh
. Anyway, there should be no need to export
the PATH
variable, because it is already exported, inherently (it couldn't work if it wasn't).
上一篇: 从它所在的目录运行Shell脚本