Simple rclone usage

Simple rclone usage

Bhadoo

Note: This is for simple rclone usage on Windows PC.

Requirements

  1. Latest rclone zip from https://rclone.org/downloads
  2. A Windows PC
  3. Brain

What and why?

  1. I don't understand complex things, so i try to find simple tutorials myself. I hope you guys find this useful.
  2. We'll use simple things to stay focused on easy usage.
  3. We'll use rclone to copy data from google drive to another google drive (TD or root).
  4. We'll use rclone to copy data from google drive to local on PC.
  5. We'll use rclone to copy data from local on PC to google drive .

Making Service Account

  • Now go to that service account, go to key and click Add Key
  • Save the file as 1.json or as per your needs.

Setup rclone and config

  • If you don't know, this is basic working of rclone explained here and nothing fancy.
  • Download and Extract rclone from https://rclone.org/downloads
  • Extract it in C: or D: drive, as per your needs, you can zip and backup it whenever you want to.
  • extract main files in rclone folder like C:\rclone and also place your 1.json service account file in it.
  • Open CMD as Admin and enter below command, change path if you have chosen another.
setx /m PATH "C:\rclone;%PATH%"
  • with this you can run rclone without specifing path of that folder anytime, anywhere.
  • make a file rclone.conf in the rclone folder.
[mydrivename1]
type = drive
client_id =
client_secret =
scope = drive
root_folder_id = 
service_account_file =
C:\rclone\1.json
team_drive = YourTeamDriveID
server_side_across_configs = true
  • You can add this config in your rclone.conf and add multiple drives as per your need. Keep a space in each config in the file for each drive.
  • Your main setup is done.

Note: Before anything else you do further, make sure you add the Service Account Email to both places from where you want to do data transfer in Folder or Shared Drives.

Clone One Team Drive to Another Team Drive

  • Eg. Drive One is mydrivename1 and Drive Two is mydrivename2 in rclone.conf
  • Instead of copy use sync in rclone as this way if something stops in between you can just resume it later or using another Service Account. This can also be done if source drive data is updated or changed.
rclone sync mydrivename1: mydrivename2: --progress
  • This above command means cloning entire TD or if you have set root folder then it'll clone root folder. (i suggest not to use root folder unless you know what you're doing)
rclone sync "mydrivename1:My Folder" "mydrivename2:MyFolder" --progress
  • You can add " double quotation mark if your folder names have spaces in them.
  • Here above command is to clone specific folder to specific place.
  • Incase limit is hit you can change service account in rclone.conf and use the command and it will resume the work.
  • rclone sync skips the files which are already synced.

Download Data from Team Drive to PC

  • If you want to download a folder without much effort and keeping the structure intact, this is the command to use.
  • Eg. Drive One is mydrivename1 is from where you want to clone folder MyFolderofData
  • Eg. Local Folder is D:\MyDownloadedFolder
rclone sync "mydrivename1:MyFolderofData" "D:/MyDownloadedFolder" --progress
  • I think \ slash doesn't works so change it to / slash to make it work.

Upload Data from PC to Team Drive

  • Download and Upload is same process, just simple change in command is as below.
rclone sync "D:/MyDownloadedFolder" "mydrivename1:MyFolderofData" --progress

The syntax is as follow

rclone ---> this is to run rclone

sync ---> this is the rclone command, sync https://rclone.org/commands/rclone_sync/

"D:/MyDownloadedFolder" ---> is here your source drive or folder

"mydrivename1:MyFolderofData" ---> is here your destination drive or folder

--progress ---> is to show the process, if you remove this, you'll not see the progress but the work will continue in background.


Note: double quotaion are not necessary but it cannot read it if there is a space in your folder name so use when you can, to avoid problems.


If you need help with any issue on this please ask me the question to add solution in the tutorial in the Telegram Channel @HashHackers comment section.

Report Page