Blog · November 30, 2026 · 12happy team
Cron logs: where to find them, and how to see what a job printed
“Did my cron job run?” has two parts, and the system log only answers one of them. The cron log tells you that cron started the job. It doesn’t tell you what the job printed or whether it succeeded. This guide covers both: where the log is on each system, and how to keep a job’s own output.
Where the cron log is
Ubuntu and Debian
Cron writes to the system log, tagged CRON:
grep CRON /var/log/syslog
Newer Debian releases don’t install rsyslog by default, so there may be no /var/log/syslog.
The systemd journal has the same entries:
journalctl -u cron
journalctl -u cron --since "1 hour ago"
The service is called cron on Ubuntu and Debian.
To get a separate /var/log/cron.log, open /etc/rsyslog.d/50-default.conf, remove the # in
front of the line that starts with cron.*, and restart rsyslog:
sudo systemctl restart rsyslog
RHEL, CentOS, Rocky, AlmaLinux and Fedora
Cron has its own file, and the service is called crond:
sudo tail -f /var/log/cron
journalctl -u crond
Docker containers
Many container images have no syslog daemon, so cron’s own messages go nowhere. Send each job’s
output somewhere you can read, as shown below, or to the container’s output with
>> /proc/1/fd/1 2>&1 so docker logs picks it up.
What a log line tells you
A typical entry on Ubuntu looks like this:
Nov 30 03:00:01 web1 CRON[21877]: (root) CMD (/usr/local/bin/backup.sh)
That’s the user (root) and the command cron started. That’s all. There’s no output, no exit
status and no line when the job finishes. If the backup failed halfway, this line looks exactly
the same.
To find one job, search for its command:
grep CRON /var/log/syslog | grep backup.sh
Where the job’s output goes
By default, cron emails anything a job prints to the crontab’s owner, or to the address in
MAILTO. Most servers have no mail system set up, so the output is thrown away, and the log
says so:
CRON[21877]: (CRON) info (No MTA installed, discarding output)
That line is the most common reason “the job ran, but I can’t see what it did”.
Keep a job’s output
Redirect it to a file in the crontab line. >> appends, and 2>&1 keeps the error output too:
0 3 * * * /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1
To know when each line was written, pipe it through ts from the moreutils package, which puts
a timestamp in front of every line:
0 3 * * * /usr/local/bin/backup.sh 2>&1 | ts >> /var/log/backup.log
To keep the exit status as well, save $? straight after the job, before anything else can
change it:
0 3 * * * /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1; s=$?; echo "$(date -u) exit $s" >> /var/log/backup.log
A file you append to forever will fill the disk eventually. Add it to logrotate, for example in
/etc/logrotate.d/backup:
/var/log/backup.log {
weekly
rotate 8
compress
missingok
}
When there’s no log line at all
If the job doesn’t appear in the log at the time you expected, cron never started it. The usual causes:
- Cron isn’t running. Check with
systemctl status cron(orcrond). - The schedule isn’t what you think. Paste it into a cron expression explainer to read it in plain English.
- The crontab didn’t save.
crontab -lshows what cron actually has. - A
%in the command. In a crontab line,%means a new line. Escape it as\%, which matters fordate +%Fand similar. - The time zone. Cron uses the server’s time zone, which is often UTC.
If the line is there but the job didn’t do its work, it’s usually the environment: cron runs with
a short PATH and none of your shell’s settings. Use full paths to commands and files.
Logs show what happened. They don’t tell you when nothing did.
All of the above helps after you go looking. None of it tells you that the nightly backup hasn’t run for a week because a server was rebuilt and the crontab didn’t come with it.
That’s what a heartbeat monitor is for: the job calls a URL when it finishes, and if the call
doesn’t arrive on time, you get an alert. With &&, the call is only made when the job succeeded:
0 3 * * * /usr/local/bin/backup.sh && curl -fsS -m 10 https://<heartbeat URL> > /dev/null
12happy’s heartbeat monitors alert by email, Slack, Telegram or push in the iPhone and Android app when a job is late. They’re on Pro and Agency; see how to monitor cron jobs for the setup, intervals and grace periods. Dedicated cron monitors work the same way; here’s how 12happy compares with Cronitor and Healthchecks.io.
To try it, sign up free and start the 14-day Pro trial from Plan; heartbeat monitors aren’t on the free plan.
Comparing uptime monitors? See all comparisons →