Monthly
Find the largest files in Google Drive
A monthly email lists the 30 largest files you own in Google Drive, with size, last change date and folder link, so you know what to delete.
- Runs
- Monthly
- Apps
- Google Drive
- AI
- Not needed
- Access
- drive.metadata.readonly
Send this to your assistant
Create a ClickRuntime automation: on the 1st of each month, email me the 30 largest files I own in Google Drive with their size in MB, last modified date and a link, plus total storage used.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
When Google storage fills up, Gmail stops receiving mail and Drive stops syncing, and Drive's own storage page is slow to sort through. Most of the space usually sits in a handful of old videos and archives.
Once a month this automation asks Drive for the files you own sorted by the storage they use, and emails you the 30 largest with their size, the date they were last changed and a link. It adds your total usage and how much is sitting in the trash.
Small business owners on a single Google account and anyone sharing a family storage plan use it to keep space in check before the "storage full" warning arrives.
What you get out of it
The big files first
Sorting by quota used puts the files that actually free space at the top.
Last changed date
Old, untouched files are the easy deletes, and the date makes them obvious.
Trash included
Files in trash still count against the quota. The email shows how much you get back by emptying it.
Report only
Nothing is moved or deleted without you deciding.
Monthly, before it is urgent
A regular look means you never hit a full mailbox because Drive ran out of space.
How it works
What happens, step by step
On the first of each month the automation asks Drive for files you own, sorted by size.
It keeps the 30 largest and notes their size, type and when they were last changed.
It also reads your total storage use and how much of it sits in Drive versus trash.
You get one email you can work through to free up space.
Before it runs live
- Connect Google Drive
What you get
Build your own
Need it to work differently?
Your own rules
Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.
Any number of apps
One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.
AI where it helps
Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.
On a schedule or on each event
Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.
Changes you can ask for
- Run it at a different time, more or less often, or only on weekdays
- Add an AI step, for example to summarize, sort or draft a reply
- Add another app, for example also send it to Slack
- Combine it with other Google Drive steps into one automation
Under the hood
The code that runs this automation
import datetime
from clickruntime import on_trigger, credentials, http, notify
TOP = 30
def drive(path, **params):
resp = http.get(f"https://www.googleapis.com/drive/v3{path}", params=params,
headers={"Authorization": f"Bearer {credentials.connection('google', 'work')}"})
resp.raise_for_status()
return resp.json()
@on_trigger
def run(event):
files = drive("/files", q="'me' in owners and trashed = false and mimeType != 'application/vnd.google-apps.folder'",
orderBy="quotaBytesUsed desc", pageSize=TOP,
fields="files(name,quotaBytesUsed,modifiedTime,webViewLink)")["files"]
q = drive("/about", fields="storageQuota")["storageQuota"]
gb = lambda b: int(b or 0) / 1024 ** 3
lines = [f"{int(f['quotaBytesUsed']) / 1024 ** 2:8,.0f} MB {f['name']} (last changed {f['modifiedTime'][:10]})\n {f['webViewLink']}"
for f in files if int(f.get("quotaBytesUsed") or 0) > 0]
trash = int(q.get("usageInDriveTrash") or 0) / 1024 ** 2
limit = f"{gb(q['limit']):.0f} GB" if q.get("limit") else "unlimited"
notify.email_me(f"Drive: {gb(q['usage']):.1f} of {limit} used, top {len(lines)} files",
"\n".join(lines) + f"\n\nTrash: {trash:,.0f} MB (empty it in Drive to reclaim)")
return {"files": len(lines), "usage_gb": round(gb(q["usage"]), 2)}FAQ
Common questions
Does it delete anything?
Why do Google Docs not show up?
Is the storage figure shared with Gmail and Photos?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Back up your data to Drive every night
Each night your data is saved to a dated Drive folder, and backups older than 30 days go to trash.
See how it worksKeep your uploads folder sorted
New files get a dated name and move into folders by type, and duplicates are reported to you.
See how it worksArchive a website to Drive as Markdown
Each page of a site is saved in Drive as a Markdown file you can read or reuse.
See how it worksKeep exploring
Set up “Find the largest files in Google Drive” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.