Schedules: automating your server
What this is about
DraftThe uploadSchedules tab lets your server do things on its own: restart every
night, take a backup before a restart, warn players before shutting down, or
send you a Discord message when it crashes.
Every schedule is made of three parts:
Looking for the simple "start at noon, stop at 3pm" walkthrough? See Creating a time based schedule. This article goes further.
Before you start: set your server's timezone
Time-based triggers use your server's timezone, not your computer's. New servers are set to System, which follows the clock of the machine your server runs on. Set it to your own timezone so "4:00 AM" means 4:00 AM for you: go to Settings → Timezone, pick your timezone (the list is searchable) and click Save.
The trigger editor reminds you which timezone it's using: "Times use the server timezone (…)".
Creating a schedule
Each step saves when you click Create or Save in progress.its window. On the Conditions tab, click Update to save. The panel warns you if you try to leave with unsaved changes. To change the name or triggers later, click Edit at the top. Use Run Now at the top to test a
schedule straight away instead of waiting for its trigger.
Triggers: when it runs
A schedule can have several triggers. It runs when any of them fires.
Time triggers
Pick how often it Runs (Every few minutes, Every few hours, Daily, Weekly, Monthly) and fill in the time. Click View Calendar to see the upcoming runs and check it's doing what you expect.
Need something the picker can't do? Tick Edit as cron expression. The panel uses six fields with seconds first:
second minute hour day-of-month month day-of-week
0 0 4 * * *
Every day at 4:00 AM
0 0 */6 * * *
Every 6 hours, on the hour
0 30 3 * * 1
Mondays at 3:30 AM
0 0 4,16 * * *
Every day at 4:00 AM and 4:00 PM
Always set the seconds field to 0. A * there means "every second" and the schedule will run over and over.
Conditions: should it run?
Conditions are checked before any actions run. If they're not met, the schedule skips that run. Useful ones:
Combine several with AND (All must be true), OR (Any must be true) or NOT (Must not be true).
If you click Run Now, you can choose Run now (check conditions first) or Run now (ignore conditions).
Actions: what it does
Steps run top to bottom, one at a time. Drag them to reorder. The most useful ones:
say Restarting in 5 minutes)
Send Power Signal
Start, Restart, Stop or Kill the server
Sleep
Waits. The duration is in milliseconds: 60000 = 1 minute
Wait for Server State
Waits until the server is e.g. Offline before continuing
Wait for Console Line
Waits until the console prints something (e.g. Server started)
Create Backup
Takes a backup of the server files
Delete Backup
Deletes the oldest/latest/a named backup
HTTP Request
Calls a URL, e.g. a Discord webhook
If / Else If / Else / End If
Only runs some steps when a condition is true
Ensure
Stops the schedule here unless a condition is true
Exit
Stops the schedule here
There are also file steps (Write File, Copy File, Delete Files, Rename Files, Compress Files, Decompress File, Pull File) and startup steps (Update Startup Variable, Update Docker Image).
Each step has an Ignore Failure switch. Turn it on if the schedule should carry on even when that step fails, e.g. a Send Command while the server happens to be offline.
Milliseconds catch everyone out. 5 seconds = 5000, 1 minute = 60000, 5 minutes = 300000.
Recipes
1. Nightly restart with warnings
Trigger: Time Interval, Daily at 04:00 Condition: Server State is Running Actions:
say Server restarting in 5 minutes!
Sleep: 240000 (4 minutes)
Send Command: say Server restarting in 1 minute!
Sleep: 60000
Send Power Signal: Restart
The say command differs between games. Vintage Story uses /announce <message>.
Minecraft uses say <message>. Check your game's admin commands.
2. Daily backup that cleans up after itself
Trigger: Time Interval, Daily at 05:00 Actions:
Your server has a backup limit (shown at the top of the Backups tab). Deleting the oldest each day keeps you under it. For a smarter approach, use a backup group with retention. See Backups.
Vintage Story on a non-ZFS node? Back up only while the server is stopped, or run /genbackup first. See Backing Up Vintage Story Safely. A safe version of this recipe: Stop → Wait for Server State Offline → Create Backup → Start.
3. Safe backup for Vintage Story (stop, back up, start)
Trigger: Time Interval, Daily at 05:00 Actions:
/announce Server going down for a backup in 1 minute
Sleep: 60000
Send Power Signal: Stop
Wait for Server State: Offline, timeout 120000
Create Backup
Send Power Signal: Start
4. Get a Discord message when the server crashes
In Discord: Server Settings → Integrations → Webhooks → New Webhook, then Copy Webhook URL.
Trigger: Crash Actions:
POST
URL: your webhook URL
Header: Content-Type = application/json
Body: {"content": "⚠️ My server just crashed!"}
Sharing schedules
From a schedule's menu you can Export it as a file, and drag that file onto another server's Schedules tab to import it. Duplicate makes a copy on the same server.
Troubleshooting
0.
A restore step keeps re-running. Don't combine Restore Backup with Server State or Power Action triggers. The restore itself changes the server state and can trigger the schedule again.


