Rclone, under Linux, can mount Google Drive, OneDrive, WebDAV, FTP, etc., which is a magical tool. Below are the installation and usage instructions. 1. Install Rclone 1. Install necessary applications yum -y install wget unzip screen fuse fuse-devel 2. Install Rclone curl https://rclone.org/install.sh | sudo bash or wget https://downloads.rclone.org/rclone-current-linux-amd64.zip unzip rclone-current-linux-amd64.zip mv rclone-v* rclone cd rclone 2. Mount Google Drive 1. Mount GDrive rclone config Select n to create a new link and name it gdrive . Then select Google Drive Leave client_id and client_secret blank and press Enter, select 1 for SCOPE, leave root_folder_id and service_account_file blank and press Enter, select n for Edit advanced config and Use auto config At this time, a link will appear, copy it to the browser, get the authorization code, and paste the authorization code into the terminal. Mount Google Drive to a directory on your server. To facilitate future web access, you can mount it to /www/wwwroot/ (the following demonstration is /www/wwwroot/gdrive.xxx.com, and gdrive.xxx.com is changed to your own domain name) ./rclone mount gdrive: /www/wwwroot/gdrive.xxx.com --allow-other --allow-non-empty --vfs-cache-mode writes 2. Set up rclone to start at boot First copy the rclone executable file to /usr/bin: cp /root/rclone/rclone /usr/bin/rclone Create a new rclone.service file: vi /usr/lib/systemd/system/rclone.service Paste: [Unit] Description=rclone [Service] User=root ExecStart=/usr/bin/rclone mount gdrive: /www/wwwroot/gdrive.xxx.com --allow-other --allow-non-empty --vfs-cache-mode writes Restart=on-abort [Install] WantedBy=multi-user.target Reload daemon to make the new service file take effect: systemctl daemon-reload Start rclone: systemctl start rclone Set the startup: systemctl enable rclone 3. Rclone Operation 1. List the remote directory (gdrive is created previously) rclone lsd gdrive 2. Copy files rclone copy source file/directory target directory The source file/directory and the target directory must be absolute paths, which can be servers, network disks, etc. If you want to save Gdrive shared by others, you can save it to your own network disk first, and then copy these files to your own network disk to prevent the shared person from deleting the files. rclone copy gdrive:gongxiang/japan gdrive:gongxiang/self 3. Synchronize files rclone sync source file/directory target directory This only syncs the files that are not there. Suitable for files with large changes. |
>>: CombCloud: 58 yuan/month/1GB memory/20GB SSD hard disk/500GB traffic/15Mbps/KVM/Hong Kong CN2
DeinServerHost, a German hosting provider, was es...
Alibaba Cloud offers a 50% discount on the lightw...
VPS in USA, a new merchant, mainly provides OVZ V...
ZXhost is a British hosting company, founded in 2...
Pyclouds, a Chinese merchant, is newly establishe...
CoalCloud, a Chinese merchant and a formal compan...
3.1 Advertising Format: Beautify Your Advertiseme...
CubeCloud, a Chinese hosting company, was founded...
eBesucher is the most famous automatic surfing mo...
DeinServerHost, a German hosting provider, was es...
VPS.Net's VPS has launched four new data cent...
OVZH.COM is a professional cloud computing hostin...
HostQala is a Singaporean hosting company founded...
81vps seems to be a new merchant. It now has spec...
Nextarray is a company registered in Dallas in 20...