Skip to main content

Rclone

Download

https://rclone.org/downloads/

Configuration

Verify the installation,

> rclone --version
rclone v1.64.2
- os/version: Microsoft Windows 10 Pro 22H2 (64 bit)
- os/kernel: 10.0.19045.3570 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.21.3
- go/linking: static
- go/tags: cmount

Google Drive

Reference:

https://rclone.org/drive/

tip

The HTTP/HTTPS proxy need to be set to access Google Drive in case your country block the Google service.

set HTTP_PROXY=http://127.0.0.1:7890
set HTTPS_PROXY=%HTTP_PROXY%
rclone config
@rem create a new remote
n
@rem remote name
gdrive
@rem choose google drive storage
18

Google Service Account

Please refer to below link to create your own client id and the service account,

https://rclone.org/drive/#making-your-own-client-id

Note the transfer limitation per service account is 750 GB per day.

Usage

List remotes

rclone listremotes

List the directory under the path

rclone lsd gdrive:

Get the size of a path

rclone size gdrive:

Download the remote path to local

rclone copy gdrive:tutorial  E:\tutorial --progress --drive-acknowledge-abuse

To improve the download performance,

rclone copy gdrive:tutorial  E:\tutorial --progress --drive-acknowledge-abuse --transfers 50

Note to use --drive-acknowledge-abuse with service account, the service account shall have the Manager role.

  • Increase the transfer from 4(default) to 50.

Useful arguments:

--drive-stop-on-download-limit

Delete content of remote path

The delete is used to delete content with selective filters,

Check https://rclone.org/commands/rclone_delete/ for the provided filters,

rclone delete gdrive:tutorial --progress

If you want to delete all the content, use pruge,

rclone purge gdrive:tutorial --progress

Empty the trash or delete old file versions

rclone cleanup gdrive: --progress

Note that Google Drive takes some time (minutes to days) to empty the trash even though the command returns within a few seconds.

Remove Duplicated Files

Refer to https://rclone.org/commands/rclone_dedupe/

rclone dedupe gdrive:

Make source and dest identical, modifying destination only

Refer to https://rclone.org/commands/rclone_sync/

rclone sync source:path dest:path [flags]

Limitation

  • The root folder of the Google Drive cannot be deleted,

E.g.

rclone purge gdrive:

All contents must be inside a folder,

rclone purge gdrive:1

TODO

  • Transfer files through Google Drives, no need to download and upload.