Archangel's Code Diary

Tips for Crontab

  1. Add “2>&1 >> cron.log” to redirect stderr and log output. “>>” means appending while “>” means overwriting.
  2. Check the “+x” mode of the script.
  3. Check the relative path in both the script and the cron config. Cron may run in a different directory.
  4. Check the encoding of the script. Cron may run in an environment different from bash.
  5. Check the privileges related with the files used in the script.

Comments