Daily
Get warned when a cluster backup is missing
You hear about any backed-up cluster whose newest snapshot failed or is more than a day old.
- Runs
- Daily
- Apps
- MongoDB
- AI
- Not needed
- Access
- Project Read Only
Send this to your assistant
Create a ClickRuntime automation: every day at 6am, check the latest backup snapshot of each of my Atlas clusters and email me any where it failed or is older than 24 hours.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
Cloud backups feel safe until you try to restore one. In Atlas, a snapshot can fail after a configuration change, a paused cluster may stop producing snapshots, or a policy change can shorten the schedule, and none of this is obvious unless you look. The first time a team notices is when they need last night's data after a bad migration and find the newest snapshot is nine days old.
Each day ClickRuntime lists your projects and clusters, fetches the snapshots for each one, and checks the newest snapshot's status and createdAt time. If the latest is failed, or nothing completed in the last day, you get an alert naming the cluster.
Teams storing customer or financial data in Atlas, or preparing for a compliance review, tend to rely on it.
What you get out of it
You learn backups broke before you need one
An alert the morning after a failed snapshot gives you a day to fix the policy. Discovering it during a data loss event leaves you with last week's data. You have a full day to fix the policy instead of discovering the gap after a bad migration.
Missing snapshots count, not just failures
A cluster that silently stopped producing snapshots has no failed status to report. Checking the newest createdAt time catches that case too, which simple failure alerts miss. Failure alerts alone miss a cluster that simply stopped producing snapshots, and the createdAt check catches that case.
Recovery point is known
When the daily check passes, you know the newest restore point is under 24 hours old. That figure is something you can quote to customers and managers with confidence. That figure is one you can quote to customers and managers with confidence.
Evidence for compliance
Many frameworks require proof that backups run and are monitored. A daily check with a log of results in the ClickRuntime dashboard demonstrates that monitoring exists. A daily check and its logged results show that monitoring exists, which many reviews ask for.
Every cluster is covered
New clusters are picked up automatically because the check lists them each day. A cluster created last week for a client project cannot drift outside the safety net. A cluster created last week for a client project cannot sit outside the safety net.
How it works
What happens, step by step
Every day ClickRuntime goes through every backed-up cluster in your MongoDB Atlas projects.
It looks at each cluster's newest backup snapshot.
If that snapshot failed, or is more than a day old, it is flagged.
You get an email naming each affected cluster and when its last snapshot was taken.
Before it runs live
- Connect MongoDB
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 MongoDB 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
from requests.auth import HTTPDigestAuth
ATLAS = "https://cloud.mongodb.com/api/atlas/v2"
def atlas(path, **params):
auth = HTTPDigestAuth(credentials.secret("ATLAS_PUBLIC_KEY"), credentials.secret("ATLAS_PRIVATE_KEY"))
resp = http.get(f"{ATLAS}{path}", auth=auth, params=params, headers={"Accept": "application/vnd.atlas.2024-08-05+json"})
resp.raise_for_status()
return resp.json()
@on_trigger
def run(event):
cutoff = datetime.now(timezone.utc) - timedelta(hours=24)
problems = []
for g in atlas("/groups")["results"]:
for c in atlas(f"/groups/{g['id']}/clusters")["results"]:
snaps = atlas(f"/groups/{g['id']}/clusters/{c['name']}/backup/snapshots")["results"]
latest = max(snaps, key=lambda s: s["createdAt"], default=None)
if not latest:
problems.append(f"{g['name']}/{c['name']}: no snapshots")
elif latest["status"] == "failed" or datetime.fromisoformat(latest["createdAt"].replace("Z", "+00:00")) < cutoff:
problems.append(f"{g['name']}/{c['name']}: latest snapshot {latest['status']} at {latest['createdAt'][:16]}")
if problems:
notify.email_me(f"{len(problems)} Atlas backup problems", "\n".join(problems))
return {"problems": len(problems)}FAQ
Common questions
What does the check consider a failure?
Does it work on shared M0 or M2 clusters?
Can the freshness window be longer?
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 open Atlas alerts every morning
Each morning one email lists every alert still open across your Atlas projects.
See how it worksKeep a weekly list of your Atlas clusters
Every Monday you get each cluster's project, tier, MongoDB version and state in one table.
See how it worksTrack what Atlas is costing this month
Once a week you see the running total of your pending Atlas invoice and its biggest line items.
See how it worksKeep exploring
Set up “Get warned when a cluster backup is missing” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.