A cron job is a command or script that the cron scheduler on Unix-like systems runs automatically at times defined by a five-field schedule expression.
Why it matters
Cron powers routine work: backups, log rotation, report emails, cache cleanup and certificate renewals. Because it runs unattended, failures are silent unless you check them.
Jobs can also overlap if one run takes longer than the interval, so long tasks should use a lock file. That is why heartbeat monitoring is useful: the job pings a URL when it finishes, and an alert fires if the ping does not arrive on time.
Example
# minute hour day-of-month month day-of-week command
30 3 * * 1 /usr/local/bin/weekly-report.sh
This runs the script at 03:30 every Monday, using the server's time zone.
Common mistakes
- Forgetting that cron uses a minimal environment, so commands fail without full paths.
- Not checking the time zone, then running jobs at the wrong hour.
- Sending output nowhere, so errors are never seen.
Related
Get notified when this term updates
Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.
यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.