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.
- Unzip the rclone executable to any folder you like.
- 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
Press “n” for New remote and “Enter”. Give your remote a name e.g. “my-gdrive.”
From the menu of options, select 13 for Google Drive. Press “Enter”.
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.
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”.
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.”
Leave the “ID of the root folder” prompt blank and just press “Enter.”
Leave the “Service Account Credentials” prompt blank and just press “Enter.”
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.”
Next rclone
will prompt you for permissions to your Google Account. This is required for rclone
to work.
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.
Click “Allow” to grant rclone
access to your Google Drive.
Upon successful authentication and grant, you’ll observe the following success message. You can now close the browser window.
At the “Configure this as a team drive” prompt, press “n” and then “Enter.”
At the Final prompt press “y” for “Yes this is OK” and press “Enter.”
Press “q” to quit the remotes setup configuration wizard.
[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.