cronjobs
Cron jobs are scheduled tasks in Unix-like operating systems managed by the cron daemon. They enable automatic execution of commands or scripts at specific times or intervals. Cron has a long history in Unix-like systems and remains widely used for routine maintenance and batch processing.
Cron jobs are defined in crontab files, which can be per-user or system-wide. A crontab line contains
The common syntax consists of five time fields: minute (0-59), hour (0-23), day of month (1-31), month
Environments are typically minimal; commands should use full paths, and scripts should set necessary environment variables.
In modern contexts, Kubernetes provides a similar concept called CronJob, which schedules Jobs in a cluster
Best practices include keeping tasks idempotent, avoiding overlapping runs, monitoring execution, enabling logging, and restricting permissions.