[filebrowser]后台保持网盘运行
Abstract: 防止ssh断开时,网盘也断开无法使用。工具systemd
设置systemd服务
vim /etc/systemd/system/filebrowser.service
写下如下内容:
[Unit]
Description=File Browser
After=network.target
[Service]
ExecStart=/home/filebrowser/filebrowser -c /home/filebrowser/filebrowser.json
[Install]
WantedBy=multi-user.target
ExecStart里填写要执行的指令,也就是filebrowser的启动指令。
随后启动服务
systemctl daemon-reload
- 运行:
systemctl start filebrowser.service - 停止运行:
systemctl stop filebrowser.service - 开机启动:
systemctl enable filebrowser.service - 取消开机启动:
systemctl disable filebrowser.service - 查看当前状态:
systemctl status filebrowser.service
Last modified on 2025-12-29