curl https://rclone.org/install.sh | sudo bash
rclone config
mkdir -p /home/gdrive
新建一个/usr/lib/systemd/system/rclone.service 文件内容为:
/etc/systemd/system
[Unit]
Description=rclone
[Service]
User=root
ExecStart=rclone mount gd: /home/gdrive --allow-other --allow-non-empty --vfs-cache-mode writes
Restart=on-abort
[Install]
WantedBy=multi-user.target
重载 daemon,让新的服务文件生效:
systemctl daemon-reload
用 systemctl 来启动 rclone
systemctl start rclone
设置开机启动:
systemctl enable rclone
停止、查看状态可以用:
systemctl stop rclone
systemctl status rclone
systemctl restart rclone
systemctl daemon-reload
用 systemctl 来启动 rclonesync
systemctl start rclonesync
设置开机启动:
systemctl enable rclonesync
停止、查看状态可以用:
systemctl stop rclonesync
systemctl status rclonesync
systemctl restart rclonesync
rclone sync /home/backup gd:backup
crontab -l
vim /etc/crontab
vi /etc/crontab
crontab -e
vps使用rclone挂在google drive
收到1条评论
ZephyrXT 2021-02-25 15:02
#!/bin/bash
#/usr/bin/rclone sync /home/backup gd:backup
rsync -av --delete /home/backup /home/gdrive
25 02 * * * /root/sync.sh
#/usr/bin/rclone sync /home/backup gd:backup
rsync -av --delete /home/backup /home/gdrive
25 02 * * * /root/sync.sh