Quote:
Originally Posted by krishnar
user@krishnar6:~$ cat /tmp/crontab.out
/home/user/test.sh: line 3: mkdir: command not found
user@krishnar6:~$
|
Ok, that explains. Cron has a reduced environment. That includes the content of the PATH variable. Therefore it does not find the mkdir executable.
Run
The output will probably be /bin/mkdir or /usr/bin/mkdir.
That is the full path to mkdir. Use that in the script. So e.g.:
Code:
/bin/mkdir /home/user/cron
For this reason it is good practice to always use absolute paths to commands in cronjobs.