Where cron jobs are stored, and how to list all of them

On this page

Cron jobs live in several places, and crontab -l shows only one of them: your own crontab. Each user has a file in the cron spool directory, system jobs sit in /etc/crontab and /etc/cron.d, and scripts in the /etc/cron.hourly, daily, weekly and monthly folders run on that rhythm.

Where are cron jobs stored?

PlaceWhat it holds
Personal spoolOne crontab per user, in /var/spool/cron/crontabs/<user> on Debian and Ubuntu and /var/spool/cron/<user> on Fedora and Red Hat. Read your own with crontab -l, and another user's with sudo crontab -u <user> -l.
/etc/crontabThe main system crontab, with a user column. Read it with cat /etc/crontab.
/etc/cron.d/System crontab files from packages and administrators, each with a user column. Read them with cat /etc/cron.d/*.
Hourly to monthly foldersScripts in /etc/cron.hourly, /etc/cron.daily, /etc/cron.weekly and /etc/cron.monthly that run once per period, with no schedule inside them. List one with ls -l /etc/cron.daily.
/etc/anacrontabJobs that anacron catches up after the machine was off. Read it with cat /etc/anacrontab.

Do not edit the spool files directly. Use crontab -e, which checks the syntax and tells cron about the change. The spool files are readable only by root, which is why you cannot just cat another user's crontab.

How do you list the cron jobs of every user?

Loop over the accounts and ask for each crontab. Run it with sudo, because only root may read another user's jobs:

shell
for user in $(cut -d: -f1 /etc/passwd); do
  sudo crontab -u "$user" -l 2>/dev/null | grep -v '^#' | grep -v '^$' | sed "s/^/$user: /"
done

Each line of output starts with the user that owns the job. The loop hides the "no crontab for user" message, skips comment lines, and reads only accounts that exist in /etc/passwd, so users that come from a directory service need their own list.

How do you see the system and folder jobs?

shell
cat /etc/crontab
sudo sh -c 'cat /etc/cron.d/*'
ls -l /etc/cron.hourly /etc/cron.daily /etc/cron.weekly /etc/cron.monthly

Scripts in the four folders are started by a helper that runs everything in the folder. On Debian and Ubuntu, a file there with a dot in its name, such as backup.sh, is skipped, so name it backup. The time each folder runs is set in /etc/crontab or /etc/anacrontab, not in the script.

Which scheduled jobs does cron not show?

  • systemd timers. systemctl list-timers --all lists each timer with its next and last run. See cron vs systemd timers and the systemd OnCalendar syntax.
  • at jobs. One-off jobs queued with at show in atq.
  • Application schedulers. Kubernetes CronJobs, a Laravel or Sidekiq schedule and a CI schedule live in your code or cluster, not on the host. The platform guides cover them.

A job you find on a machine is not proof that it runs. Check that the cron service is up and read where to find cron logs to see when each job last started.

Who is allowed to have a crontab?

Two optional files decide it. When /etc/cron.allow exists, only the users listed in it may use crontab. When it does not exist but /etc/cron.deny does, everyone not listed there may. What happens when neither exists depends on the system, so a user who is refused should look for these two files first.

Sources

Questions and answers

Why does crontab -l show nothing when jobs are running?
It shows only the crontab of the user who runs it. The jobs may belong to another user, to root, or to a file in /etc/cron.d or one of the daily and hourly folders. Use the commands above to look in each.
How do I see all cron jobs for a single user?
Run sudo crontab -u username -l. Without sudo, crontab -l shows your own.
Where is the root crontab?
In the same spool directory as every other user, in a file named root. Read it with sudo crontab -l and edit it with sudo crontab -e.
How do I know when a listed job last ran?
The listing shows the schedule, not the history. Cron logs each start to the system log, and a heartbeat check records every run; see how to check if a cron job ran.
Know the moment a job goes quiet

Create a check, add one curl to the job, and CronMissed alerts you when a ping is late or reports a failure.

Start monitoring