Steps for using RClone with Google Drive

  1. Get your Google Drive Api Client ID and Client Secret, either in saved in your computer or directly with Google at https://console.developers.google.com/
  2. Install RClone
  3. Run the command rclone config
  4. Run the following options:
    • n) New Remote
    • name> drive (or whatever other name you want)
    • storage> drive
    • client_id> PASTE YOUR CLIENT ID FROM GOOGLE DRIVE API HERE
    • client_secret> PASTE YOUR CLIENT SECRET FROM GOOGLE DRIVE API HERE
    • scope> 1
    • root_folder_id> LEAVE BLANK
    • service_account_file> LEAVE BLANK
    • Edit advanced config? | y/n> n
    • Use auto config? | y/n> y
    • DO THE LOGIN IN THE BROWSER WINDOW OPENED
    • Configure this as a team drive? | y/n> n
    • Is this remote OK? | y/e/d> y
    • What to do now? | e/n/d/r/c/s/q> q

RClone Commands

List files

Standard ls is recursive

rclone ls remote:path

With the param --max-depth you can decide how much recursive the ls will be, with value 1 it is not recursive

rclone ls remote:path --max-depth 1

List directories

rclone lsd remote:path

Copy files

rclone copy remote:path local:path

rclone copy local:path remote:path

Move files

rclone move remote:path local:path

rclone move local:path remote:path

Create folder

rclone mkdir remote:folder

Move file or directory

rclone moveto source:something destination:something

Deleting files

Delete a empty folder

rclone rmdir remote:folder

Delete all empty folders inside a directory

rclone rmdirs remote:folder

Delete a filled folder

rclone purge remote:folder

Delete a file

rclone delete remote:file.ext

Advanced delete

Delete files bigger than 100MB inside a folder

rclone --min-size 100M delete remote:path

Get size of file

rclone size remote:file

Show file content

rclone cat remote:file

Sync

Simple sync

Show progress

Show what would be synced, withou syncing, useful for knowing exactly what would be changed, to prevent data loss