Beginner Topic 15 of 50 DevOps & Tooling
Cron Jobs
Scheduled recurring tasks.
How it works
Cron is a scheduler daemon that runs commands at set times. Each line in a crontab has five time fields, minute, hour, day of month, month and day of week, followed by the command, so 30 2 * * * runs daily at 02:30. Users edit theirs with crontab -e, and system jobs live in /etc/cron.d. Cron runs with a minimal environment and a short PATH, and sends output by mail unless it is redirected. systemd timers and cloud schedulers offer similar features with logging and dependency handling.
Where it is used
It runs backups, report generation, certificate renewal, log cleanup and data syncing on a schedule.
Common pitfall
Jobs fail silently when paths or environment variables differ from your shell, overlapping runs can corrupt data and time zones or daylight saving cause skipped or doubled runs. Use absolute paths, log output, add locking with flock and monitor that jobs actually ran.
Where it fits in the course
Cron Jobs is topic 15 of 50 in DevOps & Tooling, rated Beginner. It follows grep, sed and awk. The next topic is SSH Keys.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the DevOps & Tooling quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the DevOps & Tooling quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Cron Jobs?
Where do people use Cron Jobs?
What is the most common mistake with Cron Jobs?
What should I learn before this topic?
How can I practice it?
Is Cron Jobs hard to learn?
How long does it take to learn Cron Jobs?
Which topics are related to Cron Jobs?
What should I study after Cron Jobs?
Related topics
- grep, sed and awk (DevOps & Tooling)
- SSH Keys (DevOps & Tooling)
- Pipes and Redirection (DevOps & Tooling)
- Build Systems (DevOps & Tooling)