Weekly
Check that your Fly volumes have recent snapshots
Once a week you see the newest snapshot date for each volume, with any that are falling behind flagged.
- Runs
- Weekly
- Apps
- Fly.io
- AI
- Not needed
- Access
- org or deploy token (read)
Send this to your assistant
Create a ClickRuntime automation: every Monday, email me each volume in my Fly app 'db' with its newest snapshot date, and flag any older than 2 days.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Fly.io volumes hold the data that matters, such as a Postgres database or user uploads, and snapshots are the only protection against corruption or an accidental delete. Fly takes snapshots automatically, but when retention is changed, a volume is new, or snapshots fail, nobody gets a warning. The first time you learn that the last snapshot is a month old is the day you need to restore. Hope is not a strategy.
Every week, ClickRuntime lists the volumes of your app, lists the snapshots for each, flags any volume whose newest snapshot is older than a limit you set, and emails you the result. If all volumes are covered, the email says so in one line.
It is worth having for any app with persistent data, particularly where one person looks after infrastructure.
What you get out of it
Find missing snapshots before you need them
A weekly check shows a volume whose newest snapshot is stale. You fix it now rather than finding out in the middle of an incident. That means fewer nasty surprises and a calmer recovery.
Confirm new volumes are protected
A volume created last week might not have a snapshot yet. The report shows it right away so you can take one manually. A manual snapshot takes seconds and closes the gap right away.
Back up your restore plan
Knowing the date of the latest snapshot per volume tells you how much data you could lose. That number is what you need for planning recovery objectives. Clear numbers help you decide whether daily snapshots are frequent enough for your data.
Reduce the chance of silent failure
Automation fails quietly when settings change. A separate check that reads the actual snapshots tells you the truth, not just that a feature is enabled. Verification beats assumption every time.
Provide proof for customers
Customers asking about backups get a dated record that snapshots exist. That helps with procurement questionnaires and security reviews. Clear answers make questionnaires faster to complete. Dated reports also satisfy auditors.
How it works
What happens, step by step
Once a week, ClickRuntime lists the volumes in your Fly.io app.
For each volume it finds the date of the newest snapshot and flags any that are too old.
You get one email listing every volume with its newest snapshot date, with a warning sign next to the ones falling behind.
Before it runs live
- Connect Fly.io
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 Fly.io steps into one automation
Under the hood
The code that runs this automation
from datetime import datetime, timedelta, timezone
from clickruntime import on_trigger, credentials, http, notify
APP = "db"
API = f"https://api.machines.dev/v1/apps/{APP}/volumes"
@on_trigger
def run(event):
headers = {"Authorization": f"Bearer {credentials.secret('FLY_API_TOKEN')}"}
cutoff = datetime.now(timezone.utc) - timedelta(days=2)
lines, flagged = [], 0
for vol in http.get(API, headers=headers).json():
snaps = http.get(f"{API}/{vol['id']}/snapshots", headers=headers).json()
newest = max((s["created_at"] for s in snaps), default=None)
old = newest is None or datetime.fromisoformat(newest.replace("Z", "+00:00")) < cutoff
flagged += old
lines.append(f"{'⚠ ' if old else ''}{vol['name']} ({vol['id']}, {vol['region']}): "
f"newest snapshot {newest[:10] if newest else 'none'}")
notify.email_me(f"Fly volume snapshots for {APP} ({flagged} flagged)", "\n".join(lines))
return {"flagged": flagged}FAQ
Common questions
How old is too old for a snapshot?
Does a snapshot guarantee I can restore?
Can it take a snapshot automatically?
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
Get a weekly list of your Fly.io apps
Each Monday you get every app in your organization with how many Machines it runs, where, and in what state.
See how it worksShut down staging Machines overnight
Staging Machines stop in the evening and start again before work, and you only get an email if one refuses.
See how it worksHear in Slack when a Fly Machine stops or fails
If a Machine in your app leaves the started state, your channel gets one message naming it and its region.
See how it worksKeep exploring
Set up “Check that your Fly volumes have recent snapshots” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.