cat << EOF |sudo tee -a /usr/lib/systemd/system/rclone.service
[Unit]
Description = rclone
[Service]
User = root
ExecStart = /usr/bin/rclone mount gdrive: /www/wwwroot/nextcloud/data/user/files/googledrive --cache-dir /Temp --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000
Restart = on-abort
[Install]
WantedBy = multi-user.target
EOF
重载daemon,让新的服务文件生效:
systemctl start rclone
设置开机启动:
systemctl enable rclone
停止、查看状态可以用:
systemctl stop rclone
systemctl status rclone
ps -ef | grep rclone
重启你的VPS,然后查看一下rclone的服务起来没,接着查看一下盘子挂上去没:
reboot
查看挂载状态
systemctl status rclone
df -h