Automation · 7 min read · Beginner
Cron Jobs & systemd Timers
Schedule recurring backups, SSL renewals, and cleanup jobs using 5-field cron expressions and systemd timers.
What you'll learn
- Read and write 5-field cron schedules (minute, hour, day, month, weekday)
- Inspect active systemd timers like certbot.timer
- Log cron job output so silent failures are never missed
A standard cron schedule has five fields: MINUTE HOUR DAY_OF_MONTH MONTH DAY_OF_WEEK:
0 3 * * *-> Every day at 3:00 AM (great for nightly SQLite backups).*/15 * * * *-> Every 15 minutes.0 9 * * 1-> Every Monday at 9:00 AM.
Fill-in-the-Blank Exercise
Nightly Backup Cron Expression
Schedule a job to run every day at 02:30.
* * * /usr/local/bin/backup.sh >> /var/log/backup.log 2>&1Live Bash Lab
Bashcron_guide.sh
Expected OutputClick “Run Live” to compile with GNU Bash
SCHEDULE MEANING */5 * * * * Every 5 minutes 0 3 * * * Daily at 03:00 0 9 * * 1 Every Monday at 09:00
Check Your Understanding
Score: 0 / 1
1. When does the cron expression `0 4 * * *` run?
Study Workspace
Finished this lesson?
Your progress is saved locally in your browser, no account needed.