📝 update document.

This commit is contained in:
rainerosion 2021-01-18 16:50:13 +08:00
parent 5a5c24eeaf
commit 64bd4d68f7
2 changed files with 9 additions and 49 deletions

View File

@ -80,35 +80,14 @@ wget https://github.com/rainerosion/E5SubBotForSQLite/releases/download/0.2.2/E5
tar xvjf E5SubBot_linux_x64.tar.gz tar xvjf E5SubBot_linux_x64.tar.gz
# create folder # create folder
mkdir /opt/e5sub mkdir /opt/e5sub
# move file # Move file
mv ./E5SubBot /opt/e5sub/E5SubBot mv ./E5SubBot /opt/e5sub/E5SubBot
# Add execution permission # Add execution permission
chmod a+x /opt/e5sub/E5SubBot chmod a+x /opt/e5sub/E5SubBot
# Modify configuration file # Modify configuration file
vim /opt/e5sub/config.yml vim /opt/e5sub/config.yml
``` # Download Systemd unit file
sudo wget -O /etc/systemd/system/e5sub.service https://raw.githubusercontent.com/rainerosion/E5SubBotForSQLite/master/e5sub.service
- Edit service file
```bash
vim /etc/systemd/system/e5sub.service
```
- Copy the following text
```reStructuredText
[Unit]
Description=Telegram E5Sub Bot
[Service]
Type=simple
WorkingDirectory=/opt/e5sub
ExecStart=/opt/e5sub/E5SubBot
Restart=always
RestartSec=30
[Install]
WantedBy=multi-user.target
``` ```
- Start service - Start service
@ -146,6 +125,7 @@ errlimit: 5
cron: "1 */3 * * *" cron: "1 */3 * * *"
bindmax: 3 bindmax: 3
dbfile: "e5sub.db" dbfile: "e5sub.db"
lang: zh_CN
``` ```
`bindmax`, `notice`, `admin`, `errlimit` can be hot updated, just update `config.yml` to save. `bindmax`, `notice`, `admin`, `errlimit` can be hot updated, just update `config.yml` to save.

View File

@ -67,9 +67,9 @@ Linux(方法一):
chmod a+x E5SubBot chmod a+x E5SubBot
nohup ./E5SubBot > /tmp/e5sub.log & nohup ./E5SubBot > /tmp/e5sub.log &
``` ```
Linux守护进程(适用于Centos) Linux守护进程(Systemd)
- 下载文件 - 下载相关文件
```bash ```bash
wget https://github.com/rainerosion/E5SubBotForSQLite/releases/download/0.2.2/E5SubBot-linux-amd64.tar.gz wget https://github.com/rainerosion/E5SubBotForSQLite/releases/download/0.2.2/E5SubBot-linux-amd64.tar.gz
@ -83,29 +83,8 @@ mv ./E5SubBot /opt/e5sub/E5SubBot
chmod a+x /opt/e5sub/E5SubBot chmod a+x /opt/e5sub/E5SubBot
# 编辑配置文件(文件内容请阅读部署配置) # 编辑配置文件(文件内容请阅读部署配置)
vim /opt/e5sub/config.yml vim /opt/e5sub/config.yml
``` # 下载Systemd unit文件
sudo wget -O /etc/systemd/system/e5sub.service https://raw.githubusercontent.com/rainerosion/E5SubBotForSQLite/master/e5sub.service
- 编辑systemd文件
```bash
vim /etc/systemd/system/e5sub.service
```
- 复制以下内容填入上述文件
```reStructuredText
[Unit]
Description=Telegram E5Sub Bot
[Service]
Type=simple
WorkingDirectory=/opt/e5sub
ExecStart=/opt/e5sub/E5SubBot
Restart=always
RestartSec=30
[Install]
WantedBy=multi-user.target
``` ```
- 重载配置启动服务 - 重载配置启动服务
@ -143,6 +122,7 @@ errlimit: 5
cron: "1 */3 * * *" cron: "1 */3 * * *"
bindmax: 3 bindmax: 3
dbfile: "e5sub.db" dbfile: "e5sub.db"
lang: zh_CN
``` ```
`bindmax`,`notice`,`admin`,`errlimit`可热更新,直接更新`config.yml`保存即可 `bindmax`,`notice`,`admin`,`errlimit`可热更新,直接更新`config.yml`保存即可