Skip to main content
Hello, and welcome to this lesson on verifying the completion of scheduled jobs on CentOS Stream 8 (and similar Linux systems). By default, cron, anacron, and at write activity to the system logging facility. That makes it straightforward to confirm whether scheduled jobs ran and, when needed, to capture their output.
A dark presentation slide showing the heading "Demo" and the text "Verify Completion of Scheduled Jobs" on the left. The right side has a large video placeholder with a small film camera icon and a KodeKloud logo in the top-right.

Why this matters

System administrators frequently need to verify that scheduled tasks completed successfully or produced the expected output. Knowing where and how cron/anacron/at log their activity helps you troubleshoot failures, capture output, and set up notifications.

Cron — per-user crontab

To demonstrate, add two simple per-user cron jobs that run every minute. Edit the crontab with crontab -e and add these lines:
Cron records job execution events in /var/log/cron. The log lines include the literal “CMD” for executed commands, making it easy to filter for executions:
Note: Some systems include the command output in the logs under keys like “CMDOUT” or similar. If you expect output from a cron job, search /var/log/cron for CMDOUT or query the journal with journalctl. When finished testing, remove the user crontab entry:

System-wide crontab (/etc/crontab)

The system-wide crontab at /etc/crontab sets environment variables and shows the expected syntax (including the user field). It also contains MAILTO, which cron/anacron uses to email job output if system mail is configured:

Anacron — for machines not running 24/7

Anacron is designed for systems that may be powered off periodically. Jobs use a named identifier, which simplifies searching logs. Example /etc/anacrontab:
To run anacron jobs immediately (suppress random delay), use:
Force execution regardless of last-run timestamps with -f:
Anacron logs show start/stop events in /var/log/cron, but they typically only note that output was produced rather than including the full stdout. Example:
Capture anacron job output in the systemd journal by piping to systemd-cat. Edit the job entry:
Force anacron to run and then inspect the journal:
Remember to remove any temporary test entries from /etc/anacrontab after testing.

at (one-off scheduled jobs)

at schedules one-time jobs. To schedule a job to run in one minute and capture its output to the journal:
  1. Create the at job; after entering your commands finish with Ctrl-D:
The at daemon logs job starts to /var/log/cron:
Because we piped the job to systemd-cat, its output appears in the journal:

Quick comparison: cron, anacron, and at

Practical tips

  • Use journalctl to search by custom identifiers when you pipe output through systemd-cat.
  • If your distribution doesn’t use /var/log/cron, check /var/log/messages or /var/log/syslog, or query the journal directly.
  • Configure MAILTO in /etc/crontab or per-user crontab if you have local mail delivery enabled and prefer email notifications for output.
On some distributions, scheduled-job messages are recorded in /var/log/messages or /var/log/syslog instead of /var/log/cron. If you don’t find entries in /var/log/cron, search those files or use journalctl to query the systemd journal.

Summary

  • Check /var/log/cron for CROND/CMD messages to verify cron job execution.
  • Anacron reports job starts/stops; to capture output, pipe the job to systemd-cat and then inspect journalctl.
  • at logs job starts in the system logs; use systemd-cat to capture output into the journal when needed.
  • Use MAILTO for email delivery of job outputs if you have the mail system configured.
Links and references

Watch Video

Practice Lab