Schedules
Schedules run commands and power actions on a timer, for example a restart every night at 05:00 or a backup every 6 hours.
How a schedule looks
Each schedule in the list shows:
- its name
- Last run at (
neveruntil it first runs) - the five cron fields: MINUTE, HOUR, DAY (MONTH), MONTH and DAY (WEEK)
- a status: ACTIVE or inactive
Create a schedule
- Open Schedules and click Create schedule.
- Name it, for example
Nightly restart. - Fill in the five cron fields (see below).
- Keep it active and save it.
- Open the schedule and add one or more tasks.
The cron fields
A * means "every".
| Field | Allowed values | Meaning |
|---|---|---|
| MINUTE | 0-59 | Minute of the hour |
| HOUR | 0-23 | Hour of the day, 24-hour clock |
| DAY (MONTH) | 1-31 | Day of the month |
| MONTH | 1-12 | Month of the year |
| DAY (WEEK) | 0-6 (or 1-7) | Day of the week. Check the value of Sunday on your screen before relying on it. |
Useful patterns:
*/30in MINUTE means every 30 minutes.0,30means at minute 0 and minute 30.1-5in DAY (WEEK) means a range of days.
Examples
| What you want | MINUTE | HOUR | DAY (MONTH) | MONTH | DAY (WEEK) |
|---|---|---|---|---|---|
| Every day at 05:00 | 0 | 5 | * | * | * |
| Every 30 minutes | */30 | * | * | * | * |
| Every 6 hours, on the hour | 0 | */6 | * | * | * |
| Every day at 04:00 and 16:00 | 0 | 4,16 | * | * | * |
| First day of every month at 03:00 | 0 | 3 | 1 | * | * |
note
The schedule time is not necessarily your local time. After saving, compare Next run with the time you expect and adjust the hour until it matches.
Tasks
A schedule does nothing until you add tasks. A task can be:
- Send command: types a command in the server console, for example
say Restarting in 5 minutesorsave-all. - Power action: Start, Restart, Stop or Kill the server.
- Create backup: makes a backup. This needs a free backup slot.
Tasks run in order. Each has a time offset, a wait counted from the previous task.
Example: warned restart every day at 05:00
Create a schedule named Daily restart with MINUTE 0, HOUR 5, and * in the other fields. Add these tasks:
- Send command
say The server restarts in 1 minute, offset 0 seconds. - Send command
save-all, offset 55 seconds (Minecraft). - Power action Restart, offset 5 seconds.
The steps run roughly one minute after the schedule starts.
Example: backup before restart
- Create backup, offset 0.
- Power action Restart, with an offset long enough for the backup to finish (a few minutes for a big server).
Tips
- Keep a schedule inactive while you test it, then switch it on.
- Do not schedule a backup every few minutes: backup slots are limited. Delete old ones from Backups.
- Once a day is plenty for restarts on most servers.
- If a schedule did not run, check Last run at and that the schedule is active.