On a schedule
Back up your Supabase storage files to Google Drive every night
Every night new and changed files in your Supabase storage bucket are copied to a Drive folder, and you get an email summary.
- Runs
- On a schedule
- Apps
- Google Drive, Supabase
- AI
- Not needed
- Access
- Supabase service key; Drive write
Send this to your assistant
Create a ClickRuntime automation: every night, check my Supabase storage bucket for new or updated files, upload them to my Drive 'Backups' folder and email me a summary.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A two-person startup stores customer uploads in Supabase storage. Everything works, but there is no second copy anywhere. One mistaken delete or a broken migration, and contracts and images customers uploaded would simply be gone.
This automation copies new and changed files from your storage bucket to Google Drive every night and emails you what it did. You get an independent backup without running any servers or scripts of your own.
What you get out of it
A second copy outside your database provider
Keeping files in Drive as well as Supabase means one account problem or mistaken delete does not lose everything.
Only what changed is copied
Files already backed up are skipped, so each night's run is quick and Drive does not fill with duplicates.
Proof the backup ran
The nightly email shows how many files were copied, so you notice quickly if something stops working.
Easy to browse and restore
Files sit in an ordinary Drive folder, so finding and downloading one does not need any technical tools.
How it works
What happens, step by step
Every night ClickRuntime lists the files in your Supabase storage bucket.
It compares each file with what it backed up before and skips anything unchanged.
New and changed files are downloaded and uploaded to your Drive 'Backups' folder.
You get an email with the number of files copied and their names.
Before it runs live
- Connect Google Drive
- Connect Supabase
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 and Supabase steps into one automation
Under the hood
The code that runs this automation
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from googleapiclient.http import MediaInMemoryUpload
from clickruntime import on_trigger, credentials, http, state, notify
SUPABASE_URL, BUCKET, FOLDER_ID = "https://yourproject.supabase.co", "uploads", "your-backups-folder-id"
@on_trigger
def run(event):
key = credentials.secret("SUPABASE_SERVICE_KEY")
h = {"Authorization": f"Bearer {key}", "apikey": key}
files = http.post(f"{SUPABASE_URL}/storage/v1/object/list/{BUCKET}", headers=h,
json={"prefix": "", "limit": 1000, "sortBy": {"column": "updated_at", "order": "asc"}}).json()
done = state.get("versions") or {}
changed = [f for f in files if f.get("id") and done.get(f["name"]) != f["updated_at"]]
drive = build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
for f in changed:
content = http.get(f"{SUPABASE_URL}/storage/v1/object/{BUCKET}/{f['name']}", headers=h).content
drive.files().create(body={"name": f"{f['updated_at'][:10]} {f['name']}", "parents": [FOLDER_ID]},
media_body=MediaInMemoryUpload(content, mimetype=f.get("metadata", {}).get("mimetype", "application/octet-stream"))).execute()
done[f["name"]] = f["updated_at"]
state.set("versions", done)
notify.email_me(f"Supabase backup: {len(changed)} files copied", "\n".join(f["name"] for f in changed) or "No changes tonight.")
return {"copied": len(changed), "total": len(files)}FAQ
Common questions
Which files are backed up?
What happens to a file that changes?
Are deleted files removed from Drive?
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
Keep a Drive folder searchable in your Supabase vector table
New and updated documents in your Drive Knowledge folder are split into chunks, embedded and kept in step in your Supabase documents table, so your app always searches current content.
See how it worksDraft answers to support questions from your own documents
Each question from your support form comes back to you as a drafted answer with links to the documents it used.
See how it worksTurn a website address into a company profile in Supabase and Drive
Submit a company's website and get its mission, services, contacts and keywords saved as a row in Supabase and a profile doc in Drive.
See how it worksKeep exploring
Set up “Back up your Supabase storage files to Google Drive every night” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.