ES
Linux Automation

X-Ray: Cron Job

Task Scheduling (Crontab)

30 MIN
02 HOUR
* DOM
* MON
1 DOW

/usr/bin/backup.sh

Command

Minute (0-59)

Exact moment of the hour.

Hour (0-23)

24-hour format.

DOM (1-31)

Day of Month.

Month (1-12)

January to December.

DOW (0-6)

Day of Week (Sun=0).

"Runs the script at 02:30 AM every Monday (1), regardless of the day of the month or month."

*

Wildcard: "Every possible value"

/

Intervals: */15 (every 15)

,

List: 1,3,5 (only those)

-

Range: 1-5 (from 1 to 5)

DOM + DOW Logic (OR)

If both Day of Month and Day of Week fields are restricted (aren't *), the task runs when either field matches.

30 4 1,15 * 5

4:30 AM on the 1st and 15th, plus every Friday.

Special Shortcuts

@reboot Run once at startup
@hourly Once an hour (0 * * * *)
@daily Once a day (0 0 * * *)
@midnight Same as @daily
@weekly Once a week (0 0 * * 0)
@monthly Once a month (0 0 1 * *)
@yearly Once a year (0 0 1 1 *)
@annually Same as @yearly

* @reboot runs when the cron daemon starts, possibly before other system daemons.

logo xeland314
MINHOURDOMMONTHDOW