Skip to content

Copy Google Team Drive contents in maximum speed with Node.js and rclone.

License

Notifications You must be signed in to change notification settings

victorlish/Copy_Google_Team_Drive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Copy Google Team Drive

Let's copy all the contents of a Google Team Drive or a Google Drive Shared Folder to yours with few steps.

Motivation

  1. Backup these folders to Google Drive without using host bandwidth, or
  2. Backup these folders to other cloud storage (e.g., OneDrive).

Instruction

  1. Install Node.js
  2. Install rclone and configure it (if you haven't).
  3. Replace the rclone.conf with your rclone configuration. Use command rclone config file to see where your rclone configuration is located.
  4. Ensure the rclone.conf conrains at least one remote with a working token.
  5. Modify list.txt with the format of folder_ID===rclone_destination.
  6. You are good to go. See the Practical Case before you run the program to see if it works.

The rclone_destination is in the format with dest:destpath. The path doesn't need to have double quotes even if the path contains whitespace (tested on Windows7/10).

Practical Case

We have a known troll file contains all the Rickroll (around 1 TB), and rclone is configured with a remote called GD_team. The remote has a folder called trollYou.

We want to backup that shared folder to the remote's folder. It is noted that

  1. The folder ID of the shared link will be 1N7rmP_1y4eo8bc75muJQPHXss-GgR1ja
  2. The rclone destination will be GD_team:trollYou

By the information above, we shall have a line in the list.txt in the format of N7rmP_1y4eo8bc75muJQPHXss-GgR1ja===GD_team:trollYou, put it in list.txt.

Lanuch the application with node app.js in the terminal (i.e., Cmd, Powershell, etc.).

Notes

  1. If you don't have rclone in your path environment variable, you must change rcloneCommand in app.js to the path of rclone (e.g., C:/rclone/rclone.exe or wherever rclone is located).

  2. The function of without using host bandwidth only works when rclone destination is Google Drive remote. See rclone documentation for details.

  3. The list.txt are multi-lines allowed and theoretically unlimited lines allowed.

  4. The drawback of the program is you have to update the rclone.conf each time before you run that, or the program may fail to run due to an expired token.