I've got a shell script myscript.sh
which calls a command, let's say mycmd
.
When i run that script from the terminal, e.g. ./myscript.sh
, everything works fine.
But when i add that script to the crontab, the output of mycmd
is empty. When i call /usr/local/bin/mycmd
inside of myscript.sh
everything works fine again.
So why i have to use the absolute path of the executable? Is it because it is not in the $PATH
of the "cron-bash"?
PATH
s? I thougt that the script runs "directly" from the users bash in the background. – Elastic Lamb Feb 06 '17 at 18:28/etc/default/cron
. – DopeGhoti Feb 06 '17 at 18:31