Cron Job
A cron job is a command or script that runs automatically on a schedule on Linux and Unix systems, managed by a background service called cron. It is used for repeating tasks such as taking backups every night, sending reports every Monday, cleaning up temporary files or renewing SSL certificates.
Each cron job is a line in a crontab file with five time fields, minute, hour, day of month, month and day of week, followed by the command to run. An asterisk means "every". Cloud platforms and CI/CD tools offer the same cron syntax for scheduled jobs.
# ┌ minute (0-59)
# │ ┌ hour (0-23)
# │ │ ┌ day of month (1-31)
# │ │ │ ┌ month (1-12)
# │ │ │ │ ┌ day of week (0-6, Sunday = 0)
0 2 * * * /home/app/backup.sh # every day at 2:00 AM
*/15 * * * * /home/app/check.sh # every 15 minutes
0 9 * * 1 /home/app/weekly-report.sh # every Monday at 9:00 AM