View Cron Jobs
Cron is a software utility which uses a time-based job scheduler in Linux operating systems.
Use Cron to schedule jobs to:
- Run scripts at fixed times, dates, or intervals.
- Automate system maintenance or administration.
- Download or sync files between different sources at regular intervals.
This tutorial will take you through the commands to list, or display your configured Cron Jobs, both for root and for your users. To learn how to set up Cron jobs, see our article Automating Server Scripts with Cron.
Root’s Cron Jobs
crontab -1
A User’s Cron Jobs
crontab -u $USERNAME -1
Example with user testuser:
crontab -u testuser -1
Hourly Cron Jobs
First view all the hourly cron jobs,
ls -la /etc/cron.hourly/
Then view a specific hourly cron job,
less /etc/cron.hourly/filename
Example with file name 0anacron:
less /etc/cron.hourly/0anacron
Daily Cron Jobs
First, view all the daily cron jobs,
ls -la /etc/cron.daily/
Then view a specific daily cron job,
less /etc/cron.daily/filename
Example with the file name logrotate:
less /etc/cron.daily/logrotate
Monthly Cron Jobs
First view all the monthly cron jobs,
ls -la /etc/cron.monthly/
Then view a specific monthly cronjob,
less /etc/cron.monthly/filename
Example with filename readahead-monthly.cron:
less /etc/cron.monthly/readahead-monthly.cron
/etc/crontab
The crontab is the file Linux uses to define, configure and schedule cron jobs.
less /etc/crontab
Example result
SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ #For details see man 4 crontabs #Example of job definition: #.------minute(0-59) #|.----hour(0-23) #||.----day of month(1-31) #|||.---month(1-12) OR jan,feb,mar,apr... #||||.--day of week(0-6)(Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat #||||| #*****user-name command to be executed