Install Rclone under Linux, mount Google Drive, OneDrive, WebDAV, FTP, etc.; copy each other, back up files, etc.

Install Rclone under Linux, mount Google Drive, OneDrive, WebDAV, FTP, etc.; copy each other, back up files, etc.

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
The following operations are based on the Centos system

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.
Select according to the prompts, usually n, y, q

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.

<<:  ReliableSite: New York dedicated server, i5-4570, 16GB memory, 2TB hard drive, 150TB monthly traffic, $41 per month; upgrade to 10Gbps bandwidth, $19 per month; free 20Gbps DDOS protection

>>:  CombCloud: 58 yuan/month/1GB memory/20GB SSD hard disk/500GB traffic/15Mbps/KVM/Hong Kong CN2

Recommend

Webhostingpad long-term discount code

Webhostingpad was founded in 2005, and the monthl...

【Black Friday】PQ.Hosting: 26% off permanently

There are many data centers to choose from. Coupo...

Recommend two WordPress themes: Theme Codename H and WQ-Base-Mobile

Both themes are exquisitely made and support both...

8 Cloud Technology 1GB RAM KVM VPS Hong Kong CN2 Simple Review

Details: 8 Cloud Technology: 70 yuan/month/1GB me...

Combozo: $14.99/year/unlimited space/unlimited traffic/free domain name/Phoenix

Combozo, launched a virtual host with high cost p...

xxmhost 1GB RAM 200Mbps Bandwidth Los Angeles CN2 GIA KVM VPS Review

Details : xxmhost: 57.2 yuan/month/1GB memory/15G...

vMbox: $7/month/2GB memory/50GB space/3TB traffic/2 IP/KVM/Los Angeles

vMbox, a stable merchant, now has a special price...

BOLTVM: $15/year/512MB RAM/25GB SSD space/500GB bandwidth/openvz

BOLTVM is a US hosting company that was establish...

GoodHosting: $10.5/year/256MB RAM/5GB SSD/1 IPv4/Unlimited traffic/KVM

GoodHosting.co was established not long ago. It m...

Afraid.org Free DNS Domain Name Resolution Registration and Usage Tutorial

1. Introduction Freedns.Afraid.org is a long-esta...