# Scheduled Restart

**Scheduled Restart** is a bundled feature provided by the `oms` addon.\
It allows the server to automatically restart at specific times of day, with configurable in-game warnings and the ability to skip the next scheduled restart via command.

This feature is ideal for keeping long-running servers healthy and synchronized without manual intervention.

***

### Behavior

At startup, the feature determines the next configured restart time.\
It monitors server time and:

* Sends in-game warning messages at configured intervals before restart
* Initiates a clean shutdown when the time is reached

***

### Skip Command

```bash
/oms feature oms:scheduled_restart skip
```

This command skips the upcoming scheduled restart and schedules the next available time instead.\
If a restart has already been skipped, the command informs you.

{% hint style="info" %}
Note: To cancel the skipped state, disable and then enable the `scheduled_restart` feature.
{% endhint %}

***

### Configuration

Config file:

```
world/serverconfig/oms-server.toml
```

```toml
[features.scheduled_restart]
enabled = true
times = ["00:00", "06:00", "12:00", "18:00"]
warning_times = ["2h", "30m", "15m", "10m", "5m", "2m", "1m", "30s", "15s", "10s", "5s", "4s", "3s", "2s", "1s"]
```

* `times` - daily restart times in 24-hour format
* `warning_times` - relative countdowns for in-game warnings

***

### Restart Script Required

OMS does not restart the server directly.\
It performs a clean shutdown - your **start script must handle the relaunch**.

See - [Restart Script Setup](/oms-wiki/addons/operatemyserver-addon/scheduled-restart/restart-script-setup.md)

***

### Stop Reason

This feature introduces the stop reason:

{% @github-files/github-code-block url="<https://github.com/c0nnor263/OperateMyServer/blob/main/feature/scheduled-restart/src/main/kotlin/io/conboi/oms/feature/scheduledrestart/foundation/reason/ScheduledStop.kt>" %}

***

### Priority

This feature is registered with `Priority.COMMON`.\
It is considered a safe, low-impact utility feature.

***

### Source Code

This feature is part of the `oms` addon.

{% embed url="<https://github.com/c0nnor263/OperateMyServer/tree/main/feature/scheduled-restart/src/main/kotlin/io/conboi/oms/feature/scheduledrestart>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://conboi.gitbook.io/oms-wiki/addons/operatemyserver-addon/scheduled-restart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
