NextCloud挂载Google Drive后实现开机自动挂载命令

3.37K 浏览
0

NextCloud挂载Google Drive后,我们还需要实现开机自动挂载,以下命令适用于适用于CentOS 7Debian 8+Ubuntu 16+

cat > /etc/systemd/system/rclone.service <<EOF
[Unit]
Description=Rclone
After=network-online.target

[Service]
Type=simple
ExecStart=/usr/bin/rclone mount nextxxx:cloudbackxxx /xxxnext \
 --umask 0000 \
 --default-permissions \
 --allow-non-empty \
 --allow-other \
 --transfers 4 \
 --buffer-size 32M \
 --low-level-retries 200 \
 --dir-cache-time 6h \
 --vfs-read-chunk-size 64M \
 --vfs-read-chunk-size-limit 1G \
 --vfs-cache-mode writes
Restart=on-abort
User=root

[Install]
WantedBy=default.target
EOF

请把ExecStart后面的挂载换成你自己的。

开始启动:

systemctl start rclone

设置开机自启:

systemctl enable rclone

其他命令:

重启:systemctl restart rclone
停止:systemctl stop rclone
状态:systemctl status rclone

分享到:
paypal 已回答的问题 2022年5月25日
添加评论
0
ExecStart=/usr/bin/rclone mount nextxxx:cloudbackxxx /xxxnext \

这里nextxxx是指remote配置的名字,
cloudbackxxx是指啥?
/xxxnext是指配置的挂载目录吧?

分享到:
Qi 发表新评论 2022年5月29日
Avatar for paypal

cloudbackxxx是指Drive里的文件夹,
/xxxnext是指配置的挂载目录,即本地目录。

添加评论
写下您的答案。

Login

Welcome! Login in to your account

Remember me Lost your password?

Don't have account. Register

Lost Password

Register