Skip to content

On a schedule

Snapshot your Droplets every night

Each Droplet gets a fresh snapshot overnight, snapshots older than your retention window are cleared, and you get an email listing what happened.

Runs
On a schedule
Apps
DigitalOcean
AI
Not needed
Access
read+write (droplet, snapshot scopes)

Send this to your assistant

Create a ClickRuntime automation: every night at 2am, take a snapshot of each DigitalOcean Droplet tagged 'prod', delete that Droplet's snapshots older than 7 days, and email me a list of what was created and removed.

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 bad deploy, a deleted database or a compromised server is the moment you find out whether you really had a backup. Many small teams mean to take Droplet snapshots, do it manually once after launch, and never again. Weeks later the only snapshot is stale, and restoring it means losing weeks of customer data.

Every night the automation lists your Droplets, optionally limited to a tag such as production, and starts a snapshot of each. It then removes snapshots beyond the newest seven for that Droplet so storage costs do not grow forever, and emails you a summary of what was created and what was deleted, including any Droplet that could not be snapshotted.

Agencies keeping client sites on Droplets and solo developers without a formal backup plan see the largest benefit.

What you get out of it

  • A week of restore points

    Seven nightly snapshots mean you can roll back to last night, or to six nights ago if the problem went unnoticed. Most data loss is spotted days after it happens, so a short history is worth much more than a single recent copy.

  • Backups that do not depend on memory

    The snapshot happens whether or not anyone remembered, including on holidays and weekends when a mistake is just as likely. Skipping the habit is easy when the server runs fine, which is exactly when the backup needs to exist.

  • Predictable storage cost

    Pruning to the newest seven keeps the snapshot bill flat as time passes. Without pruning, a year of nightly snapshots for several servers becomes a surprisingly large line item that nobody remembers agreeing to.

  • Only the servers that matter

    Using a tag means test machines are not backed up at your expense, while production Droplets always are. Spending goes to the servers whose loss would hurt, and adding a Droplet to the plan is just a matter of tagging it.

  • Proof the backup happened

    The summary email lists each snapshot started and each one removed. That is a simple paper trail when a client or auditor asks whether backups are really being taken, and especially handy for agencies with service agreements.

How it works

What happens, step by step

  1. Every night at 2, ClickRuntime lists your DigitalOcean Droplets, or just the ones with the tag you chose.

  2. It starts a fresh, dated snapshot of each one.

  3. It deletes snapshots older than the number of days you want to keep.

  4. You get an email listing the snapshots created and removed.

Before it runs live

  • Connect DigitalOcean

What you get

RunsOn a schedule
Snapshot your Droplets every nighttoday, 9:00Succeeded
Email · Droplet snapshotsSnapshots: 2 created, 2 removed Created: web-01-2026-10-19, db-01-2026-10-19

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 Slack
  • Combine it with other DigitalOcean 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.
take_automatic_droplet_snapshots.pyexample
from datetime import date, datetime, timedelta, timezone
from clickruntime import on_trigger, credentials, http, notify

DO = "https://api.digitalocean.com/v2"

def do(method, path, **kwargs):
    resp = http.request(method, f"{DO}{path}", headers={"Authorization": f"Bearer {credentials.secret('DIGITALOCEAN_TOKEN')}"}, **kwargs)
    resp.raise_for_status()
    return resp.json() if resp.content else {}

@on_trigger
def run(event):
    cutoff = datetime.now(timezone.utc) - timedelta(days=7)
    droplets = do("GET", "/droplets", params={"tag_name": "prod", "per_page": 200})["droplets"]
    ids = {str(d["id"]) for d in droplets}
    created, removed = [], []
    for d in droplets:
        name = f"{d['name']}-{date.today()}"
        do("POST", f"/droplets/{d['id']}/actions", json={"type": "snapshot", "name": name})
        created.append(name)
    for s in do("GET", "/snapshots", params={"resource_type": "droplet", "per_page": 200})["snapshots"]:
        if s["resource_id"] in ids and datetime.fromisoformat(s["created_at"].replace("Z", "+00:00")) < cutoff:
            do("DELETE", f"/snapshots/{s['id']}")
            removed.append(s["name"])
    notify.email_me(f"Snapshots: {len(created)} created, {len(removed)} removed",
                    "Created:\n" + "\n".join(created) + "\n\nRemoved:\n" + ("\n".join(removed) or "none"))
    return {"created": len(created), "removed": len(removed)}

FAQ

Common questions

Do snapshots affect a running Droplet's performance?
A snapshot can briefly slow disk activity, and DigitalOcean advises powering off for a fully consistent image of a busy database. Running at night when traffic is low keeps the impact small for most websites. For databases, a separate dump as well is a sensible extra safeguard.
How do I restrict it to certain Droplets?
Tag the Droplets you care about in DigitalOcean, for example with a production tag, and the automation lists only those. Droplets without the tag are never touched, so test servers are never snapshotted or billed, and adding a new server to the plan is just one tag.
What does a snapshot cost on DigitalOcean?
Snapshots are billed by the storage they use, per gigabyte per month, so keeping only seven per Droplet limits the cost. Check DigitalOcean's current pricing page for the rate, since it is theirs to set and can change. The nightly summary helps you see how many snapshots exist.
What permissions does it need?
read+write (droplet, snapshot scopes). 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 (on a schedule). 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 “Snapshot your Droplets every night” from your assistant

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