Every 6 hours
Clear out old exports automatically
Files of the type you name are deleted once they pass the age you set, and you get a count.
- Runs
- Every 6 hours
- Apps
- Dropbox
- AI
- Not needed
- Access
- files.content.write
Send this to your assistant
Create a ClickRuntime automation: every 6 hours, delete .png files in my Dropbox /Exports folder that are older than 48 hours, and email me how many were removed.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Some Dropbox folders are meant to be temporary: exported reports, weekly database dumps, client preview files, screen recordings. They pile up for years, eating into storage quota, and old files that nobody remembers include data you would rather not keep. Cleaning them manually means opening folders, sorting by date and deleting carefully, which never feels urgent until the account is full.
Every six hours the automation lists the folder you named, keeps files of the extension you named that were last modified before your cutoff, deletes them and emails you how many were removed. Old files disappear on schedule, while recent ones and other file types are left alone, so the cleanup needs no attention from you.
Agencies, teams that share temporary exports and anyone who pays for Dropbox storage will appreciate it.
What you get out of it
Storage costs stay under control
Removing expired exports keeps you under your storage limit, which can delay the need for a larger and more expensive plan. Space is reclaimed continuously, not in a panicked cleanup once the account is full.
Sensitive files do not linger
Old exports containing customer data are removed after a set time. That supports a sensible retention policy without anyone having to remember to enforce it, which is the part that usually fails in practice.
Folders stay easy to use
A folder with only recent files is quick to scan. People stop picking the wrong old version by accident, and a newcomer sees at a glance what is current instead of wading through years of leftovers.
Only the files you intend
Filtering by extension and age means a kept contract PDF in the same folder is not touched while temporary files are removed. Rules are explicit and predictable, so nothing is deleted on a hunch.
Proof the cleanup ran
The email reports the count deleted at each run, so you can see the schedule is working. If the number suddenly jumps or drops to zero, that is a signal worth looking at before storage fills up.
How it works
What happens, step by step
Every 6 hours, ClickRuntime looks through your Dropbox folder.
It picks out files of the type you chose, such as PNGs, that are older than your cutoff.
Those files are deleted.
You get an email with how many files were removed and their names.
Before it runs live
- Connect Dropbox
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 Dropbox steps into one automation
Under the hood
The code that runs this automation
from datetime import datetime, timedelta, timezone
from clickruntime import on_trigger, notify, http, credentials
@on_trigger
def run(event):
auth = {"Authorization": "Bearer " + credentials.connection("dropbox", "main")}
entries = http.post("https://api.dropboxapi.com/2/files/list_folder", headers=auth, json={"path": "/Exports"}).json()["entries"]
cutoff = datetime.now(timezone.utc) - timedelta(hours=48)
old = [e for e in entries if e[".tag"] == "file" and e["name"].lower().endswith(".png")
and datetime.fromisoformat(e["server_modified"].replace("Z", "+00:00")) < cutoff]
if not old:
return {"deleted": 0}
http.post("https://api.dropboxapi.com/2/files/delete_batch", headers=auth,
json={"entries": [{"path": e["path_lower"]} for e in old]}).raise_for_status()
notify.email_me(f"Removed {len(old)} old PNGs from /Exports", "\n".join(e["name"] for e in old))
return {"deleted": len(old)}FAQ
Common questions
Are deleted files gone for good?
Can it clean several folders?
How is the age of a file measured?
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
Save a converted data feed to Dropbox nightly
A file from a URL is downloaded, converted or zipped, saved to Dropbox and sent to you as a share link.
See how it worksBack up to Dropbox and keep the last 7 days
A dated backup file appears in Dropbox every night and anything older than a week is removed.
See how it worksGet warned before shared links expire
Each morning you see which of your Dropbox share links run out within the week.
See how it worksKeep exploring
Set up “Clear out old exports automatically” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.