docs: 添加 systemd 服务配置说明到 README

This commit is contained in:
krau
2025-01-22 22:01:16 +08:00
parent 48ceb87e29
commit f00aa189e3

View File

@@ -29,6 +29,31 @@ chmod +x saveany-bot
./saveany-bot
```
### 添加为 systemd 服务
创建文件 `/etc/systemd/system/saveany-bot.service` 并写入以下内容:
```
[Unit]
Description=SaveAnyBot
After=systemd-user-sessions.service
[Service]
Type=simple
WorkingDirectory=/yourpath/
ExecStart=/yourpath/saveany-bot
Restart=on-failure
[Install]
WantedBy=multi-user.target
```
设为开机启动并启动服务:
```bash
systemctl enable --now saveany-bot
```
## 更新
使用 `upgrade``up` 升级到最新版