StellarStack
Guides

Schedules

Automate server tasks with scheduled actions

Schedules

Schedules allow you to automate server tasks like backups, restarts, and commands.

Schedule Types

ActionDescription
CommandSend a console command
PowerStart, stop, restart, or kill
BackupCreate a backup

Creating a Schedule

  1. Navigate to ServerSchedules
  2. Click Create Schedule
  3. Configure the schedule:
    • Name
    • Cron expression
    • Action type
    • Action parameters
  4. Click Save

Cron Expressions

Schedules use cron syntax with 5 fields:

┌───────────── minute (0-59)
│ ┌───────────── hour (0-23)
│ │ ┌───────────── day of month (1-31)
│ │ │ ┌───────────── month (1-12)
│ │ │ │ ┌───────────── day of week (0-7)
│ │ │ │ │
* * * * *

Special Characters

CharacterDescription
*Any value
,List separator
-Range
/Step values

Examples

ExpressionDescription
0 * * * *Every hour
*/15 * * * *Every 15 minutes
0 0 * * *Daily at midnight
0 2 * * *Daily at 2 AM
0 0 * * 0Weekly on Sunday
0 0 1 * *Monthly on the 1st
0 6,18 * * *At 6 AM and 6 PM

Action: Command

Send a command to the server console.

Example: Save World

{
  "name": "Auto Save",
  "cron": "*/30 * * * *",
  "action": "command",
  "payload": {
    "command": "save-all"
  }
}

Example: Broadcast Message

{
  "name": "Restart Warning",
  "cron": "55 3 * * *",
  "action": "command",
  "payload": {
    "command": "say Server restarting in 5 minutes!"
  }
}

Action: Power

Control server power state.

Example: Daily Restart

{
  "name": "Daily Restart",
  "cron": "0 4 * * *",
  "action": "power",
  "payload": {
    "action": "restart"
  }
}

Power Actions

ActionDescription
startStart the server
stopGracefully stop
restartStop then start
killForce terminate

Action: Backup

Create a server backup.

Example: Hourly Backup

{
  "name": "Hourly Backup",
  "cron": "0 * * * *",
  "action": "backup",
  "payload": {
    "name": "scheduled-{timestamp}",
    "ignore": ["logs/*"]
  }
}

Chained Tasks

Execute multiple actions in sequence:

Example: Restart Sequence

  1. 5 min warning - 55 3 * * *

    say Server restarting in 5 minutes!
  2. 1 min warning - 59 3 * * *

    say Server restarting in 1 minute!
  3. Save world - 59 3 * * * (+30s)

    save-all
  4. Restart - 0 4 * * *

    power: restart

Schedule Management

Enable/Disable

Toggle schedules without deleting:

  1. Navigate to Schedules
  2. Click the toggle switch
  3. Schedule is now disabled/enabled

Run Now

Manually trigger a schedule:

  1. Navigate to Schedules
  2. Click the Run button
  3. Action executes immediately

View History

See past executions:

  1. Navigate to Schedules
  2. Click on a schedule
  3. View Execution History

API Access

List Schedules

curl https://api.example.com/api/v1/servers/{serverId}/schedules \
  -H "Authorization: Bearer $TOKEN"

Create Schedule

curl -X POST https://api.example.com/api/v1/servers/{serverId}/schedules \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Daily Restart",
    "cron": "0 4 * * *",
    "action": "power",
    "payload": { "action": "restart" },
    "enabled": true
  }'

Best Practices

  1. Stagger Restarts - Don't restart all servers at once
  2. Warn Players - Send messages before disruptive actions
  3. Off-Peak Hours - Schedule maintenance during low usage
  4. Test First - Use "Run Now" to verify schedules work
  5. Monitor Execution - Check history for failures