Skip to content

Weekly

Get a weekly Drive cleanup report in Slack

Every Monday you see the duplicate files, old backups and long-untouched files in your Drive, so cleanup takes minutes.

Runs
Weekly
Apps
Google Drive, Slack
AI
Not needed
Access
Drive read; Slack chat:write

Send this to your assistant

Create a ClickRuntime automation: every Monday, scan my Drive folders for duplicate files, backups older than 7 days and files nobody has touched for a year, and post the report to #it.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A ten-person agency keeps everything in a shared Drive. Over two years it has filled with copies of the same logo pack, nightly export backups nobody deletes, and project folders from clients who left long ago. Storage keeps running out and nobody knows where to start.

A short weekly report turns cleanup into a habit. The person looking after IT sees exactly which files are duplicates or stale and can clear them in one sitting, instead of buying more storage.

What you get out of it

  • Storage stays under control

    Duplicates and forgotten backups are usually the biggest wasters of space. Seeing them every week stops the slow creep towards a full Drive.

  • Cleanup has a clear list

    Instead of browsing folders and guessing, you get the file names to look at. Deleting the obvious ones takes minutes.

  • Old files get a second look

    Files nobody has opened for a year are often outdated versions that cause confusion. The report prompts a decision to archive or remove them.

  • It happens without a reminder

    The report arrives every Monday whether or not anyone remembers. Good Drive habits stop depending on one person's calendar.

How it works

What happens, step by step

  1. Every Monday, ClickRuntime looks through the files in your Google Drive.

  2. It finds files with identical content, backups older than seven days and files nobody has changed in a year.

  3. It groups them into a short report with the file names.

  4. The report is posted in your #it Slack channel.

Before it runs live

  • Connect Google Drive
  • Connect Slack, then invite the app to the channel (type /invite @ClickRuntime there)

What you get

RunsWeekly
Get a weekly Drive cleanup report in Slacktoday, 9:00Succeeded
Slack · #itDrive report: 4 duplicate sets, 9 old backups, 37 files untouched for a year. Acme-logo-pack.zip = Acme-logo-pack (1).zip

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • 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 Google Sheets
  • Combine it with other Google Drive and Slack steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
drive_hygiene_report_to_slack.pyexample
from collections import defaultdict
from datetime import datetime, timedelta, timezone
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, notify

@on_trigger
def run(event):
    drive = build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
    now = datetime.now(timezone.utc)
    files, token = [], None
    while True:
        page = drive.files().list(q="trashed=false and mimeType!='application/vnd.google-apps.folder'", pageToken=token,
                                  fields="nextPageToken,files(name,md5Checksum,modifiedTime)", pageSize=1000).execute()
        files += page.get("files", [])
        token = page.get("nextPageToken")
        if not token:
            break
    by_sum = defaultdict(list)
    for f in files:
        if f.get("md5Checksum"):
            by_sum[f["md5Checksum"]].append(f["name"])
    dups = [names for names in by_sum.values() if len(names) > 1]
    age = lambda f: now - datetime.fromisoformat(f["modifiedTime"].replace("Z", "+00:00"))
    backups = [f["name"] for f in files if "backup" in f["name"].lower() and age(f) > timedelta(days=7)]
    stale = [f["name"] for f in files if age(f) > timedelta(days=365)]
    notify.slack(f"Drive report: {len(dups)} duplicate sets, {len(backups)} old backups, {len(stale)} files untouched for a year.\n"
                 + "\n".join(" = ".join(d) for d in dups[:20]), channel="#it")
    return {"duplicates": len(dups), "backups": len(backups), "stale": len(stale)}

FAQ

Common questions

How does it spot duplicate files?
It compares the content fingerprint of each file, so two files with different names but identical content are flagged together. Files that only share a name are not treated as duplicates.
Does it delete anything?
No. It only reports what it finds. You decide what to remove, which keeps important files safe from automatic cleanup.
What counts as a backup?
Files whose name contains a word such as backup. You can adjust the words it looks for to match how your team names backups and exports.
What permissions does it need?
Drive read; Slack chat:write. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it runs (weekly). Checks that find nothing to do and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Get a weekly Drive cleanup report in Slack” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.