>_ IzzyLab

Hands-on task

This task is step 6 of the course “Cron: scheduled jobs”

The cron report has been silent since morning

easy~2 min

The morning report is supposed to be built by cron at 06:30, but it isn't. The line in root's crontab is in place, and /var/log/report.log only contains a launch error. Find the cause and fix the script itself, /opt/reports/make-report.sh, so that cron can run it. Don't change the schedule or the script's contents.

What you'll practise:
  • cron
  • troubleshooting
  • execute bit
  • chmod
  • cron logs

Topic breakdown

When a cron job "doesn't work", take it apart step by step: is the line there and is the schedule right (crontab -l), did cron run the command and what did it print (the log the output is redirected to), and what state is the program itself in. If the line names a script path, the kernel runs it via exec(), and for that the file needs the execute bit — otherwise you get Permission denied, no matter how correct the shebang is. The fix is changing the file's mode, not rewriting the cron line (a workaround like bash script treats the symptom but hides the cause).

What's checked

  1. script is executable
  2. script contents unchanged
  3. cron line in place

What it looks like