# โฐ Kubernetes CronJobs A **CronJob** in Kubernetes allows you to run jobs on a recurring schedule, similar to traditional UNIX `cron` jobs. Ideal for periodic tasks like backups, reports, or scheduled notifications. --- ## ๐Ÿ” CronJob Commands ### ๐Ÿ“„ List CronJobs in a Namespace ```bash kubectl get cronjobs.batch -n ```` ### โŒ Delete a CronJob ```bash kubectl delete cronjobs.batch -n ``` --- ## ๐Ÿงพ Example CronJob Manifest This CronJob runs every minute and prints the date followed by "Kubernetes": ```yaml apiVersion: batch/v1 kind: CronJob metadata: name: cronjob1 namespace: ns spec: schedule: "* * * * *" jobTemplate: spec: template: spec: containers: - name: cronjob image: debian:bookworm command: - /bin/bash - -c - date; echo Kubernetes restartPolicy: Never ``` > ๐Ÿ›  **Fix:** Changed `JobTemplate` to `jobTemplate` (YAML keys are case-sensitive). > ๐Ÿ• The `schedule` field follows standard cron format: `minute hour day-of-month month day-of-week`. > ๐Ÿง  **Tip:** Always test cron timing carefully to avoid unintentional frequent runs.