Imagine a tireless assistant who runs your backup every night at 2 a.m., empties a folder every Monday, and never forgets. Linux has exactly that assistant, and it is called cron. This guide to crontab for beginners explains, in plain English, how cron works, how to read its famous five-field schedule, and how to set up your first automatic task without fear.
What Is Cron, in Plain English? – Cron and Crontab for Beginners
Cron is a small background program (a “daemon”) that watches the clock. It wakes up every minute and checks a table of scheduled jobs. If the current time matches a job’s schedule, cron runs that job’s command quietly in the background.
The table is called the crontab (cron table). Every user has their own crontab, and you edit yours with the command crontab -e. Learning crontab for beginners really means learning two things: how to write a schedule, and how to attach a command to it. A schedule plus a command makes one line, called a cron job.
Cron powers a huge amount of real automation, from log cleanup to the nightly backup in our guide about automating backups with rsync and cron.
Crontab for Beginners: The Five Fields Explained – Cron and Crontab for Beginners
Every cron job line starts with five fields that describe when to run, in this order:
minute hour day-of-month month day-of-week command
- Minute (0–59): which minute of the hour
- Hour (0–23): which hour, using the 24-hour clock
- Day of month (1–31): which day of the month
- Month (1–12): which month
- Day of week (0–7): 0 and 7 both mean Sunday, 1 is Monday, and so on
An asterisk * means “every” for that field. So this line runs a script every day at 2:30 in the morning:
30 2 * * * /home/alex/scripts/backup.sh
Read it aloud: “at minute 30, hour 2, every day, every month, every weekday.” Two more helpers are worth knowing. A slash sets a step: */15 in the minute field means “every 15 minutes”. And commas make a list: 1,15 in the day-of-month field means “on the 1st and the 15th”.

Crontab for Beginners: Adding Your First Schedule
Follow these steps to create your first cron job:
Step 1: open your crontab for editing:
crontab -e
The first time, Linux may ask you to choose an editor; pick nano, the beginner-friendly one. Step 2: add a line at the bottom. Let us start with something harmless and visible — writing the date into a file every five minutes:
*/5 * * * * date >> /home/alex/cron-test.txt
Step 3: save and exit. Cron notices the change by itself; there is nothing to restart. Wait a few minutes, then check the file: cat /home/alex/cron-test.txt. New lines appearing on schedule means you just automated your first task. To see all your jobs at any time, run crontab -l.
Real schedules you might use: 0 9 * * 1 means 9:00 every Monday, and shortcuts like @daily, @weekly and @reboot (run once at startup) replace the five fields entirely. If you later explore alternatives, systemd timers are the other popular way to schedule tasks on modern Linux.
Checking Whether Cron Is Running and What It Did
On most systems cron starts automatically at boot, but if your jobs never seem to run, verify the service with systemctl status cron (on Debian and Ubuntu) or systemctl status crond (on Fedora and RHEL family systems). Look for the word “active”. When a job runs at the wrong time, the usual suspect is the system clock and timezone rather than cron itself — run date and compare it with your watch. Cron schedules follow the computer’s clock, not yours, which matters a lot on servers located in other countries.
Common Beginner Mistakes
- Using relative paths. Cron does not start in your home folder and has a very short PATH. Always write full paths:
/home/alex/scripts/backup.sh, notbackup.sh. - Forgetting the script must be executable. If your job runs a script, run
chmod +xon it first, and make sure it starts with#!/bin/bash. - Expecting output on screen. Cron has no screen. Anything your job prints is normally emailed to you or lost. Send output to a file with
>> /home/alex/job.log 2>&1so you can check what happened. - Editing the wrong file. Always use
crontab -e. Do not edit files inside/etcby hand as a beginner; one syntax slip can break scheduling for everyone. - Mixing up day fields. If you set both day-of-month and day-of-week, cron runs when either matches, not both. Most beginners leave day-of-month as
*when they schedule by weekday.
Conclusion
Cron is your computer’s alarm clock: the daemon checks the time every minute and runs commands from your crontab when the schedule matches. Master the five fields (minute, hour, day, month, weekday), use full paths, and log the output, and scheduling becomes one of the most satisfying beginner skills. The complete official reference is the crontab manual page, which lists every field and shortcut in one place.