> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://helpdesk.ggcircuit.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# ⏰ 在 Debian Linux 上提前安排重启（使用 shutdown）

|| 要在今天下午 5:30 安排重启（基于从现在起的分钟数），并进行时间检查，请按照以下步骤操作。

1. **检查服务器时间：**

* 打开终端并登录。
* 执行 `date` 命令以显示当前日期和时间：

```
root@ggRock:~# date
Thu 13 Mar 12:56:36 GMT 2025
```

* 验证显示的时间和日期是否准确。如果不准确，请使用 `timedatectl` 或 `ntpd` 调整服务器的时间。
  例如：`sudo timedatectl set-time 'YYYY-MM-DD HH:MM:SS'` 或确保您的 ntp 客户端正在运行。

2. **计算时间差：**

* 当前时间：（从 `date` 命令输出中获取）
* 所需重启时间：下午 5:30
* 时间差：计算小时和分钟的差，然后将其转换为总分钟数。
* 例如，如果当前时间是下午 1:00，时间差将是 4 小时 30 分钟，即 270 分钟。

3. **安排重启：**

* 以 root 身份登录或使用 `sudo`。
* 执行 `shutdown` 命令，将 `[minutes]` 替换为您计算的时间差：
* 示例（使用之前计算的 270 分钟）：

```
root@MediaCityGG:~# shutdown -r +270
Reboot scheduled for Thu 2025-03-13 17:31:35 GMT, use 'shutdown -c' to cancel.
```

4. **取消重启（如需要）：**

* 要取消计划的重启，执行 `shutdown -c`。

|| 重要事项：
|| 时间准确性：date 命令检查至关重要。如果服务器时间不正确，重启将在错误的时间发生，可能导致严重的中断。
|| 分钟计算：仔细检查您的分钟计算以确保准确性。
|| 关闭所有机器：在服务器重启前确保所有机器都已关闭，以避免 I/O 风暴。