A
cd ..
System

Cron Job Scheduling

Schedule automated tasks with cron jobs and crontab.

2025-09-05
cron, automation, linux

Edit crontab

crontab -e

List current cron jobs

crontab -l

Remove all cron jobs

crontab -r

Crontab syntax

* * * * * command
│ │ │ │ │
│ │ │ │ └─ Day of week (0-7, 0 and 7 = Sunday)
│ │ │ └─── Month (1-12)
│ │ └───── Day of month (1-31)
│ └─────── Hour (0-23)
└───────── Minute (0-59)

Every minute

* * * * * /path/to/script.sh

Every hour at minute 0

0 * * * * /path/to/script.sh

Every day at 2:30 AM

30 2 * * * /path/to/backup.sh

Every Monday at 9:00 AM

0 9 * * 1 /path/to/weekly-report.sh

Every 15 minutes

*/15 * * * * /path/to/check.sh

First day of every month

0 0 1 * * /path/to/monthly-task.sh

Every weekday at 6 PM

0 18 * * 1-5 /path/to/workday-task.sh

Redirect output to log file

0 2 * * * /path/to/script.sh > /var/log/cronjob.log 2>&1

Disable email notifications

MAILTO=""
0 * * * * /path/to/script.sh

Use environment variables

SHELL=/bin/bash
PATH=/usr/local/bin:/usr/bin:/bin
0 * * * * backup.sh

Was this useful?

Share with your team

Browse More