Shell Script · Lesson

Scheduling Scripts with Crontab

Cron is a time-based job scheduler in Linux used to run scripts automatically.

What is Crontab?

Crontab allows users to schedule commands or scripts at fixed times or intervals.

Edit Crontab
infounix@prod
crontab -e
Run backup daily at 2 AM
infounix@prod
0 2 * * * /home/user/backup.sh

Crontab Fields

  • Minute (0–59)
  • Hour (0–23)
  • Day of Month (1–31)
  • Month (1–12)
  • Day of Week (0–7)