A cron job is a scheduled, recurring background task on Unix- or Linux-based systems. It is managed by the cron daemon, which regularly checks whether a job is due to run according to a predefined schedule.
Automation: Automates tasks like backups, updates, email dispatch, or script execution.
Time control: You define exactly when and how often the job should run (e.g., daily at 3:00 AM or every Monday).
Configuration: Jobs are scheduled using crontabs (cron tables).
0 3 * * * /usr/bin/php /var/www/mein-skript.php
Explanation:
0 3 * * *
→ Runs every day at 3:00 AM
/usr/bin/php /var/www/my-script.php
→ The command to execute
* * * * * (Minute Stunde Tag Monat Wochentag)
Saves time through automation
Reduces human error
Ideal for repetitive tasks