How to Use Rclone Script to Copy Files From Team Drive to Team Drive | 2020

Introduction |

Hello guys. EduTechTainMent is here to show you guys how to use rclone script to copy files from team drive to team drive seamlessly. Rclone is the best option for noobs. This is particularly important if you are facing problems setting up any of the other alternatives that allow for copying terabytes of data without the daily 750Gb limit of Google- such as AutoRclone, Folderclone and Gclone. These other methods make use of service accounts. AutoRclone is particularly popular.

[expander_maker id=”1″ more=”Read more” less=”Read less”]

Why Use This Method

  1. It will take about 3 to 5 minutes to set this up and running.
  2. You can programmatically copy all files/folders in a team drive to your own personal team drive.
  3. You don’t need to add service accounts to the source team drive. This is a huge bottleneck for many because AutoRclone mostly requires you to copy SA into both the source and destination TD, but most TD administrators/owners restrict this access.
  4. Your copying task continues from where it left off the previous day if you reach your daily maximum transfer cap of 750Gb.
  5. You can however bypass this by having more than one Google account linked to the team drive (after all Google accounts are free to open).
  6. One of the many reasons why I love using this method is that it affords me the opportunity to have fine-grained control of the files I wish to copy and not just copy all the useful and some useless (at least to me) files in the source team drives since many are publicly sourced. A lot of TD admins/owners are battling with the task of organizing files in their TD. From the very get go, you can choose where you want your files to go- such as Movies folder, Series folder, Courses folder, Books, etc

Pre-requisites

  1. Rclone remotes should be setup for both your team drive and the source team drive. Read how to set it up here.
  2. AirExplorer app. | Read about it here.
  3. Notepad++
  4. Basic knowledge of Rclone commands.
  5. Windows PC (obviously)

How to Use Rclone Script to Copy Files From Team Drive to Team Drive

Setup Rclone Remotes

This is the first step. You need to setup remotes for both your personal destination team drive you want to copy files in to and the source team drive you want to copy files from. Follow this guide to get you up and running in setting up your Rclone remotes.

Name the remotes whatever you like but make sure they are names that you can easily remember and that tell you what team drives you are referring to. Another best practice is to ensure you don’t have spaces in the names. Use underscores if you must.

Open AirExplorer

This is the second step. Open your AirExplorer app. Navigate to the Team Drive you want to copy files from. For this tutorial, we are going to copy files from Bhadoo cloud drive 2. I have already set up the remotes for both my TD and Bhadoo TD. Of course you need to ensure you have already joined the Bhadoo TD through their Google Group Link. See this post for many of such TD Google group links. For the benefit of my readers, i will demonstrate how to setup an Rclone remote again in this guide.

I will name my own TD (which is my destination TD i want to copy files into) wagatechalumtd and the Bhadoo TD (which is the source TD I want to copy files from) bhadoocloud2. Notice I try to avoid spaces in the chosen names.

Navigate to the Team Drive you want to copy from. Click on the first folder. Hold down ctrl key and continously press the Page Down key until you reach the end of the folder you want to copy. Copy the selected files by pressing Ctrl C.

Open Notepad++

Open your Notepad++ and paste the folders you copied from the Bhadoo 2 TD in your AirExplorer app in the step above. You now need to pay close attention to how we are going to create this Rclone script using Notepad++.

RCLONE COMMAND

rclone copy “source_TD_rclone_remote_name:/source_folder_name” “destination_TD_rclone_remote_name:destination_folder_name” [flags]

I want to copy from “bhadoocloud2” team drive into my own “wagatechalumtd” using the flags: –drive-server-side-across-configs -v -P

The flags at the end of the command helps to ensure I don’t use my internet bandwidth data allocation while copying and also show me the progress of the task running.

I wish to copy these files into a folder in my TD i have named “BotUploads

In summary:

source_TD_rclone_remote_name = bhadoocloud2

source_folder_name = Copied using AirExplorer and pasted in the notepad++

destination_TD_rclone_remote_name = wagatechalumtd

destination_folder_name = BotUploads


rclone copy “bhadoocloud2:

” “wagatechalumtd:BotUploads” –drive-server-side-across-configs -v -P


  1. Click on the Language tab and select B. Under B select “Batch”
  2. Paste the folder names you copied from the AirExplorer app.
  3. Note that some entries aren’t part of the folder names. We need to remove these entries. There are two ways to go about this: first method is to select the text that isn’t part of the folder name and replace it with the initial part of the rclone command based on what we want to copy. To do this select the unwanted text from the 1st row and click on Control + H keys. This brings up the Replace with dialog box. The search mode should be set to “Normal“. Input the desired text in the Replace with box. In my case the entry will be: rclone copy “bhadoocloud2:
  4. The second method is shown in the picture and Giffy guide.
  5. Input the last part of the rclone command code as follows: Click on Control + H keys. This brings up the Replace with dialog box. The search mode should be set to “Regular expression“. In the Find box, input the $ mark. Input the desired text in the Replace with box. In my case the entry will be: ” “wagatechalumtd:BotUploads” –drive-server-side-across-configs -v -P
  6. Notice the space between the two ” “.
  7. That’s it. Our code is ready. All we need to do now is some minor tweaks. This isn’t really necessary but it just makes your code better looking and easy to control.
  8. Click on Control + H keys in the Notepad++. This brings up the Replace with dialog box. The search mode should be set to “Extended“. In the Find box, input the \n. Input the desired text in the Replace with box. In my case the entry will be: \n\nTIMEOUT /T 10 /NOBREAK\n\n
  9. This last code serves the following function. It creates a space between all the lines of your code on a folder to folder code execution basis. It also sets a delay time of 10 seconds per code execution. This can be circumvented by clicking on Control + C keys. You can set yours to 5 seconds if you so wish. This time allows you to view/examine the output of the CLI console while the code is being executed and determine tasks to execute or not. You can equally choose to use the Pause command in place of the TIMEOUT code above. This helps to pause the command tasks until you, the user presses the Enter key on your keyboard to execute the code.
  10. Finally, you can also decide to comment out certain parts of the code from being executed while running the script.
  11. TO COMMENT OUT CODES, WE USE THE REM COMMAND.THIS PREVENTS A PARTICULAR FOLDER RCLONE command TASK FROM RUNNING WHEN THE SCRIPT IS EXECUTED. TO DO THIS: PRESS CONTROL + A TO SELECT ALL THE TEXT IN NOTEPAD++ . THEN PRESS CONTROL + K TO COMMENT OUT ALL THE COMMAND LINES.
  12. TO COMMENT OUT SINGLE FOLDER COPY COMMAND LINES, PLACE THE CURSOR ON THE LINE, AND PRESS CONTROL + K. TO UNCOMMENT, JUST PRESS CONTROL + SHIFT + K.

EduTechTainMent Pictorial Guide

[ngg src=”galleries” ids=”8″ display=”basic_slideshow”]

EduTechTainMent Giffy Guides

Setting Up Rclone Remote

Setting Up Notepad++ and Running Rclone Script

Optional- Modifying Rclone Script

Other Rclone Commands We can Use in This Script

Rclone Size Command Syntax for Team Drives

The Rclone Size command is used to determine the size of an entire Team Drive or a specific folder within the TD.

Rclone Size command Syntax for a Whole Team Drive

rclone size “Source_or_Destination_TD_rclone_remote_name:root_directory_ of_TD” e.g. for my wagatechalum TD, if I want to determine the size of the entire TD, the syntax will be thus: rclone size “wagatechalumtd:/”

In the above code, rclone size is the rclone command syntax while wagatechalumtd is my “Source_or_Destination_TD_rclone_remote_name, and / refers to the root_directory_ of_TD.

Rclone Size command Syntax for a Specific Folder

rclone size “Source_or_Destination_TD_rclone_remote_name:/Source_or_Destination_TD_Folder_name” e.g. for my wagatechalum TD, if I want to determine the size of the BotUploads folder in my TD, the syntax will be thus: rclone size “wagatechalumtd:/BotUploads”

Rclone About Command Syntax for My Google Drives

The Rclone about command syntax is used for My Drives. If you have a Google Drive account with unlimited storage (GSuite or Edu mail accounts) and you have files in it, you can determine the amount of used space in the drive using the rclone about command. The syntax is just like the rclone size syntax for Team Drive root directory above. You must however ensure the rclone remote is configured as a Google Drive and not a Team Drive. The syntax is as show below.

rclone about “Source_or_Destination_TD_rclone_remote_name:root_directory_ of_Google Drive” e.g. for my wagatechGD, if I want to determine the size of the used space in my Google Drive, the syntax will be thus: rclone about “wagatechGD:/”

Rclone Sync and Move Commands

These have similar syntax structure to the rclone copy command we used in our guide above. Just replace copy with either sync or move. The rclone sync command is similar to the rclone copy command while the rclone move command can be used to move files from one directory to another.

Conclusion

That’s all guys!!! This won’t take you 3 to 5 minutes to set up.

JUST RUN THE BATCH SCRIPT ANYTIME YOU WANT TO COPY FOLDERS FROM THE TD WITHOUT NEED TO WRITE ANY CODE AGAIN.

YOU CAN USE SIMILAR BATCH SCRIPT METHOD FOR OTHER RCLONE COMMANDS SUCH AS “SYNC”, “SIZE“, ETC. JUST FOLLOW THE APPROPRIATE RCLONE COMMAND SYNTAX.

Visit EduTechTainMent for more of such informative posts and don’t forget to use the subscription box below to get notified whenever such posts are published on here.

Credits: Bhadoo Cloud TD for the contents copied from their TD in this guide.

[beautiful_link_preview layout=”compact” url=”https://edutechtainment.com”]

[/expander_maker]

Comment

  1. EduTech_TM Blogger

    Nice one. Testing the comment feature

    2 weeksbefore
    2020-6-23 14:13:49

Send a comment Edit comment


				
Previous
Next