Check size on individual large folders in Google Drive

One common feature that’s simply not implemented in Google Drive is individual folder size properties. So if you’re trying to determine how large a specific folder in your Google Drive is, then that can be difficult.

While it’s true that with Google File Stream, you can get info on a Google Drive folder to display its size; if your folder has hundreds of thousands of files and is terabytes in size, then the get info calculation may timeout before giving you a total.

Here’s how you can do it using rsync:

[step 1] Installing rclone

rclone is available for Mac, Windows, Linux here. Simply download the executable installer and run it. In this example I’m running Windows, so these Installation instructions are for that platform. Installation is relatively trivial and the next step is platform independent.

  1. Unzip the rclone executable to any folder you like.
  2. Add the path to the executable to your environment variables.

[step 2] Creating an rclone connection to Google Drive

Connections to remote cloud services are called “remotes” in rclone. To set one up, simply run the following command (instructions from howtogeek.com)

rclone config

rclone config in a terminal window

Press “n” for New remote and “Enter”. Give your remote a name e.g. “my-gdrive.”

rclone menu to create a new remote, in a terminal window

From the menu of options, select 13 for Google Drive. Press “Enter”.

rclone config in a terminal window

You’re prompted for a Google Application Client ID. Press “Enter” to accept the default. Alternatively and for better security, please see https://rclone.org/drive/#making-your-own-client-id for this step.

Prompt for a Google application client id in a terminal window

You’re then prompted for a Google Application Client Secret. Alternatively, if you created your own client ID, select the matching secret and enter it here. Press “Enter”.

prompt for a Google application client secret in a terminal window

Select the scope of access rclone should have to your Google Drive. For full drive access to both read and write data, press “1” and then press “Enter.”

providing the scope for rclone in a terminal window

Leave the “ID of the root folder” prompt blank and just press “Enter.”

prompt for root folder ID ina terminal window

Leave the “Service Account Credentials” prompt blank and just press “Enter.”

Prompt for Service Account Credentials in a terminal window

At the “Edit advanced config”  prompt select “n” for No and press “Enter.”

At the “Use auto config” prompt press “y” and then press “Enter.”

The "use auto config" menu in a terminal window

Next rclone will prompt you for permissions to your Google Account. This is required for rclone to work.

rclone about to launch a browser, in a terminal window

A browser window will automatically appear. Simply log into your Google account and authorize the access. If you’re already logged into Google, select the appropriate account to proceed.

Choosing the Google account to use in a browser window

Click “Allow” to grant rclone access to your Google Drive.

Allowing rclone to work with Google Drive in a terminal window

Upon successful authentication and grant, you’ll observe the following success message. You can now close the browser window.

Success message in a browser window

At the “Configure this as a team drive” prompt, press “n” and then “Enter.”

The rclone "configure this as a team drive" prompt in a terminal window

At the Final prompt press “y” for “Yes this is OK” and press “Enter.”

The rclone "yes,edit, delete" menu in a terminal window

Press “q” to quit the remotes setup configuration wizard.

The rclone final menu in a terminal window

[step 3] Running the rclone command to calculate the size of a given Google Drive folder

At a commend prompt run rclone size "<rclonedrivename>:<googledrivefoldername> and press “Enter”.

<rclonedrivename> is your rclone remote drive. If you forgot its name, simply run rclone config 

<googledrivefoldername> is the name of any root folder in your Google Drive.

This command does not give a status or feedback and can take a long time to run depending on the size of your folder (I have a Backup folder that took 4 hours to calculate). Be patient. Here’s the output and commend for finding out the size of the Backup folder in the root of my Google Drive:

C:\>rclone size "my-gdrive:Backups"
Total objects: 7127128
Total size: 5.767 TBytes (6340537571968 Bytes)

That’s it.