gdrive无限网盘挂载systemd文件
我的博客新地址:www.liuquanhao.com
---------------------------------------------------------------------
首先应该配置好rclone,然后挂载测试:
$ rclone mount config_name:/path/ local_path
测试没问题,就可以添加systemctl配置文件了:
这里也配置了代理,不然无法访问google drive,在rc-local.service里,配置了开机代理,
这样在开机后,先开代理,然后执行这个systemd文件,就可以利用代理连接上google drive了。
/lib/systemd/system/rclone_ulimit.service
[Unit] Description=rclone mount ulimit gdrive Requires=rc-local.service After=rc-local.service [Service] Type=simple User=liuxu Environment="HTTP_PROXY=http://127.0.0.1:8118/" Environment="HTTPS_PROXY=http://127.0.0.1:8118/" ExecStartPre=/bin/mkdir -p /home/liuxu/ulimit_gdrive ExecStart=/usr/bin/rclone mount ulimit_gdrive: /home/liuxu/ulimit_gdrive --config /home/liuxu/.config/rclone/rclone.conf --checkers 16 --dir-cache-time 30m --quiet ExecStop=/bin/fusermount -u ulimit_gdrive Restart=on-abort [Install] WantedBy=multi-user.target