前提条件:已将网盘在rclone上配置好

  • 先安装fuse
apt-get install fuse3       # debian
  • 创建本地文件夹
mkdir -p /home/alist 
  • 挂载网盘到本地
rclone mount alist: /home/alist --vfs-cache-mode full --vfs-cache-max-size 10G --vfs-read-ahead 128M --buffer-size 32M --dir-cache-time 5m --poll-interval 5m --attr-timeout 1m --allow-other --allow-non-empty --daemon
  • 配置开机自启文件
nano /etc/systemd/system/rclone-mount.service
  • 填入以下内容并保存
[Unit]
Description=Rclone Mount Service for alist
After=network.target

[Service]
Type=notify
ExecStart=/usr/bin/rclone mount alist: /home/alist \
    --vfs-cache-mode full \
    --vfs-cache-max-size 10G \
    --vfs-read-ahead 128M \
    --buffer-size 32M \
    --dir-cache-time 5m \
    --poll-interval 5m \
    --attr-timeout 1m \
    --allow-other \
    --allow-non-empty \
    --umask 000
ExecStop=/bin/fusermount -u /home/alist
Restart=on-failure
User=root
Group=root

[Install]
WantedBy=multi-user.target
  • 重载配置
sudo systemctl daemon-reload
sudo systemctl start rclone-mount.service #启动配置文件

sudo systemctl enable rclone-mount.service #使其开机自启动

sudo systemctl status rclone-mount.service #查看配置文件运行状态

#Linux #VPS

谁知我这种人