Tuesday, 10 September 2019

Troubleshooting cronjob

Plenty of times, perfectly working scripts can't seem to be executed properly when configured as cronjob. The annoying part is cron seem to only log the time when the script is executed and nothing else.

The solution is actually rather simple, just add the following lines to the end of your script
>/tmp/cronscript.log 2>&1

After the script is executed, you will be able to see the error messages

Hints: Most of the time, cron job is just missing the $PATH environment variable.

Cheers

No comments:

Post a Comment