>_ IzzyLab

Topic breakdown

Cron executes jobs in a stripped-down environment with a minimal PATH and without user variables, so scripts that work in the terminal often fail in cron with "command not found". This is cured with variables set as NAME=value lines (without export) at the start of the crontab, before the schedule lines — they apply to all jobs below: MAILTO sets the address for output/errors, PATH the directories to search for binaries. The schedule itself is five fields (minute, hour, day, month, day of week) and a command; "hourly" means a fixed zero minute at any hour. Everything is edited via crontab -e and checked with crontab -l.

What's checked

  1. MAILTO=admin@corp.com is set
  2. PATH=/usr/local/bin:/usr/bin:/bin is set
  3. the job.sh task runs hourly

What it looks like