rclone开机自动挂载

   
摘要GPT
摘要小助理暂时失联跑路啦……😜

假设:

  1. 你已经挂载好了GoogleDrive
  2. 不能使用systemctl的请先在root下安装
  3. apt install systemd-sysv && reboot
  4. 使用df -h命令查看是否成功

假设 name: gd 挂载目录是 /home/google 运行以下命令:

 注意修改为你的挂载名字(name),以及挂载目录,使用df -h命令查看

复制以下命令:

command=" mount gd:/ /home/google  --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000"

继续:

以下是一整条命令,一起复制到SSH客户端运行
cat > /etc/systemd/system/rclone.service <<EOF
[Unit]
Description=Rclone
After=network-online.target

[Service]
Type=simple
ExecStart=$(command -v rclone) ${command}
Restart=on-abort
User=root

[Install]
WantedBy=default.target
EOF

现在就可以使用systemctl来挂载GoogleDrive了

systemctl enable rclone  #开机自启

命令:


systemctl start rclone   #启动
systemctl restart  rclone   #重启
systemctl status rclone   #状态

完结~

知识共享许可证 CC BY-NC-SA 4.0
最后更新于 2024-07-17 18:28
使用 Hugo 构建
主题 hugo-magic小洋葱 魔改 由 Jimmy 设计
Written by Human, Not by AI