Scenario

The scheduled job says nothing

The developer ran the script by hand and it worked. On schedule it produces nothing and complains about nothing. Find both causes.

The daily report is supposed to build itself; in this scenario its schedule is squeezed down to a minute, so you do not wait until morning. There is no report file at all. Nobody noticed, because the errors went to a file nobody was reading: the job simply stopped producing a result.

The symptom

There is no report file, although the job is in the schedule and should run every minute.

$ crontab -l
* * * * * /home/student/bin/rotate-reports.sh >> /home/student/reports/cron.log 2>&1

$ ls -l --time-style=long-iso /home/student/reports/
total 4
-rw-rw-r-- 1 student student 67 2026-08-08 09:14 cron.log

$ pgrep -a cron
87 /usr/sbin/cron -P

The daemon is running, the schedule entry is there, the report is not. So the job is being started and failing, and the task is to find where its output goes. Note that cron.log appears after the first run of the job, that is at the next zero second of a minute: right after you attach it may not exist yet.

What you have to end up with

Three conditions. /home/student/reports/daily.txt holds a fresh report, built no more than three minutes ago, with the line from the report-tool program in it. The script has its execute bit. And the crontab entry is still there: building the report by hand and dropping the job is not a repair.

The job runs once a minute, so after the fix wait a minute before asking for the verdict.

How to wo

Free with account

Finish this lesson with a free account

This lesson is free once you sign in. Create an account to keep reading and open the lab.

Create a free account

Already have an account? Sign in