In short
Backups at 2 a.m., cleanup every Sunday, a report on the first of each month. You don't set alarms for these. You tell cron once, and it never forgets.
cron runs commands on a schedule on Linux and macOS using five time fields, so a Python script can run every morning or every hour without you. On Windows, Task Scheduler does the same job.

Think of it like this
The milkman who never misses
The doodhwala rings your bell at 6 a.m. every day, without you calling him. On Sundays he also brings paneer. You told him the schedule once. Cron is that milkman for scripts: give it a time pattern and a command, and it shows up on time.
Watch it happen
Reading 30 2 * * 1-5
1/5First field is the minute: 30.
The big ideas
What you need to know
Five time fields
minute, hour, day of month, month, day of week. A * means every value.
Cron has a tiny PATH
Cron runs with very few environment variables. Use full paths like /usr/bin/python3 in your jobs.
Capture the output
Redirect output to a log file with >> job.log 2>&1, or you won't know when a job fails.
systemd timers are the alternative
On modern systems, systemd timers do the same job with logs in journalctl and better retry options.
See it in code
Walk through the code
1crontab -e # edit your user's cron jobs2crontab -l # list them3 4# Every day at 2:30 a.m.: back up the database530 2 * * * /home/riya/bin/backup.sh >> /home/riya/backup.log 2>&16 7# Every 15 minutes: check disk space8*/15 * * * * /usr/local/bin/check-disk.sh9 10# 9 a.m. on the 1st of every month110 9 1 * * /usr/bin/python3 /opt/reports/monthly.py1/4crontab -e opens your personal schedule in an editor. -l prints it.
Use a site like crontab.guru to double-check a schedule before saving it.
Save yourself the pain
Common mistakes
Oops
Testing a script in your terminal, then being surprised it fails silently in cron.
Do this instead
Cron has a different PATH and no shell profile. Use absolute paths and log the output to find errors.
Oops
Forgetting the server's timezone, so a '2 a.m.' job runs at 7:30 a.m. IST.
Do this instead
Check with timedatectl. Many servers use UTC, so convert your times or set the timezone deliberately.
Your mission
Schedule your first job
Quick check
What does the cron schedule 0 */6 * * * mean?
Go deeper
- 1Schedule a script to run every day at 9 a.m. with crontab -e.
- 2Use the full path to the Python inside your virtual environment in the cron line.
- 3Redirect output to a log file so you can see failures.
More topics at this stop
Stuck on this topic? Ask an Insider
Get 1:1 guidance from people who've walked this exact path — on the InsideEdge app.