Skip to content

Schedules and triggers

Make your server act on its own, either at a set time or in response to what it prints.

A schedule runs at a time you choose. A trigger runs when a line of console output matches a pattern.

Schedules

Feature

The Schedules tab appears only when the schedules feature is on. Your administrator can also turn schedules off for the whole panel.

Use a schedule for work that happens on a clock. Common examples are a nightly restart, a warning message before that restart, and a backup every six hours.

The schedules list

Under the heading, the panel shows how many schedules you use and how many you are allowed, for example 2 of 5 schedules used. New Schedule is greyed out when you reach the limit. Delete a schedule to make room.

Each schedule is one card. The card shows:

ItemMeaning
Switch on the leftTurns the schedule on or off. An off schedule keeps its tasks but does not run.
Name and timingThe name that you gave it, and the timing written in plain words.
Clock badgeThe time until the next run, for example in 2h 5m.
Running badgeThe schedule is running its tasks now.
ChevronOpens the task list.
Three-dot menuRun Now, Edit, and Delete.
Blue badgeAppears when the schedule runs only while the server is online.

Run Now starts the schedule at once. The timing does not apply.

Delete asks first. The schedule and all of its tasks are removed, and it does not run again.

Creating a schedule

  1. Click New Schedule.
  2. Type a name in the Name field, for example Daily restart.
  3. Set the timing in the Schedule (Cron) field. The panel writes the timing in plain words under the field.
  4. To start the schedule now, set Schedule is active.
  5. If the tasks need a running server, set Only run when server is online.
  6. Add at least one task. See below.
  7. Click Create Schedule.

A schedule needs a name and one task. The panel refuses to save without them.

Timing

The timing field takes a cron expression with five parts, separated by spaces:

minute  hour  day-of-month  month  day-of-week

Six preset buttons sit under the field. Click one to fill in the field:

PresetExpression
Every 5 minutes*/5 * * * *
Every 15 minutes*/15 * * * *
Every 30 minutes*/30 * * * *
Every hour0 * * * *
Every 6 hours0 */6 * * *
Every 12 hours0 */12 * * *

You can also type your own expression. For example, 30 4 * * * runs at 04:30 every day.

WARNING

Times use the clock of the panel server, not the clock of your computer. If you are in a different time zone, a schedule runs at a different local time than you expect.

Tasks

Click Add Task for each step. Tasks run in the order that they appear.

Task typeWhat it does
Send CommandSends a line to the server console, for example say Restart in 5 minutes.
Power ActionStarts, stops, restarts, or kills the server.
Create BackupTakes a backup of the server.

Each task has a Delay in seconds. The delay is the wait before that task runs. A delay of 0 runs the task at once.

A common pattern for a nightly restart uses four tasks:

  1. Send Command say Server restarts in 5 minutes, delay 0.
  2. Send Command say Server restarts in 1 minute, delay 240.
  3. Send Command say Restarting now, delay 60.
  4. Power Action Restart, delay 5.

Use the bin icon on a task to remove it.

Only run when server is online

If this option is set and the server is not running at the scheduled time, the panel skips the whole run. Nothing happens, and the schedule waits for the next scheduled time.

Turn the option off for a schedule that must start the server.

When a task fails

If a task fails, the panel stops that run. The tasks after the failed task do not run.

The schedule stays on. It runs again at the next scheduled time.

The card reports the failure. It marks the last run as failed and gives the reason. Open the task list on the card to see which task stopped the run. The mark stays until the next run succeeds.

Permissions for other users

PermissionAllows
ViewSee the schedules and their tasks.
CreateAdd new schedules.
UpdateEdit existing schedules and turn them on or off.
DeleteDelete schedules.

Triggers

The Triggers tab watches the console output of the server. When a line matches your pattern, the trigger runs one or more actions.

Availability

The Triggers tab appears only for games where the panel knows how to read the console output.

Use a trigger for work that depends on what the server says, not on the clock:

  • Restart the server when a known crash message appears.
  • Welcome a player by name when they join.
  • Send a webhook to your chat when a critical error appears.
  • Kick a player who types a banned phrase.

The triggers list

The table shows one row per trigger:

ColumnContent
NameThe name that you gave it. Disabled triggers say (disabled).
PatternThe text pattern that the trigger looks for.
ActionsThe action types on this trigger.
FiredHow many times the trigger has run.

Each row has an Edit link and a Delete link.

Egg defaults

Click Install egg defaults to add the triggers that ship with the game template. The panel skips any trigger that you already have. Some templates ship none, and the panel tells you so.

This is a good starting point. Install the defaults first, then edit them.

Creating a trigger

  1. Click New trigger.
  2. Type a Name, for example restart-on-crash.
  3. Type a Regex pattern. This is the text pattern that the trigger looks for in each console line.
  4. If the pattern can match many times in a row, set Throttle (ms). See below.
  5. Leave Enabled ticked.
  6. Pick an action type and fill in its field. Click Add action for more actions.
  7. Click Save.

A trigger needs a name, a pattern, and at least one action.

The match

The pattern is a regular expression. The panel tests it against every line that the server prints.

A named group in the pattern captures part of the line. Write a group as (?P<name>...). You can then use $name in an action.

For example, this pattern captures the player name from a join message:

^(?P<player>\S+) connected from

An RCON action of say Welcome $player then greets the player by name.

WARNING

A pattern that matches too much fires too often. Test a new trigger with a harmless action, such as Notify, before you point it at a restart.

Throttle

The throttle is a wait in milliseconds. After the trigger fires, it ignores further matches until that time passes.

Set a throttle when a crash writes the same line many times. A throttle of 60000 limits the trigger to one run per minute. Leave it at 0 for a pattern that matches rarely.

The action

Pick an action type from the dropdown. The field next to it changes with the type:

ActionFieldWhat it does
RCON commandThe commandSends the command to the running server.
RestartNoneRestarts the server.
StopNoneStops the server.
KillNoneStops the server process at once.
WebhookA URLSends a request to that URL.
NotifyA messageSends a notification in the panel.

One trigger can hold several actions. They run in the order that you list them. Use the bin icon to remove an action.

Which one to use

GoalUse
Restart at 04:00 every dayA schedule
Restart when the log says the world failed to saveA trigger
Back up every six hoursA schedule
Alert your chat when a plugin errorsA trigger
Warn players before a planned restartA schedule

Next steps

  • Backups to back up on a timetable
  • Console to read the output a trigger watches
  • Server users to let somebody else manage your schedules

BadgerPanel Documentation