Skip to content

On a schedule

Back 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.

Runs
On a schedule
Apps
Dropbox
AI
Not needed
Access
files.content.write

Send this to your assistant

Create a ClickRuntime automation: every night at 1am, export my records from https://api.example.com/export to a JSON file named with the date in Dropbox /Backups, then delete backups there older than 7 days.

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 business's important data often exists in only one place: a hosted database, a spreadsheet export, a CMS dump or an API's records. The provider may have its own backups, but those are theirs, and getting a restore can take days or may not be offered at all. Teams mean to copy the data somewhere safe regularly, do it once, and then forget, and the first real loss reveals that the only copy is months old.

Each night the automation fetches the data, uploads it to Dropbox as a file with the date in its name, lists the backup folder and deletes the oldest files beyond the number you keep. You end up with a rolling window of recent backups that never fills your storage.

Small companies, freelancers with client sites and anyone relying on a hosted service with limited export options will find it reassuring.

What you get out of it

  • A copy you control, outside the provider

    If a service shuts down, loses data or locks your account, you still hold your own copy in Dropbox. That independence is the point of a backup, and it is cheap to keep.

  • Dated files make restores simple

    Each backup carries its date in the filename, so you can pick the version from before a bad import or a mistaken deletion. Finding the right restore point takes seconds instead of guesswork.

  • Rotation keeps storage bounded

    Deleting the oldest backups beyond your limit means the folder stays the same size month after month. A forgotten backup job that quietly fills your Dropbox is a common and avoidable nuisance.

  • Nothing depends on someone remembering

    Backups taken by hand stop on the first busy week. A nightly schedule continues through holidays, illness and staff changes, so the safety net is still there when you most need it.

  • A quick answer for auditors and clients

    When someone asks how you protect the data, you can point to a folder of dated backups. For many small businesses, that is the difference between a convincing answer and an awkward pause.

How it works

What happens, step by step

  1. Every night, ClickRuntime fetches the data you want backed up.

  2. It saves it to your Dropbox backups folder as a file with today's date in the name.

  3. It then deletes backups older than seven days, so the folder only keeps the last week.

Before it runs live

  • Connect Dropbox

What you get

RunsOn a schedule
Back up to Dropbox and keep the last 7 daystoday, 9:00Succeeded
Dropbox · /BackupsUploaded backup-2026-10-19.json (2.4 MB) · Deleted backup-2026-10-11.json

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 Dropbox 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.
nightly_backup_to_dropbox_with_rotation.pyexample
import json
from datetime import date, datetime, timedelta, timezone
from clickruntime import on_trigger, http, credentials

@on_trigger
def run(event):
    records = http.get("https://api.example.com/export", headers={"Authorization": "Bearer " + credentials.secret("EXPORT_API_KEY")}).json()
    auth = {"Authorization": "Bearer " + credentials.connection("dropbox", "main")}
    http.post("https://content.dropboxapi.com/2/files/upload", headers={**auth, "Content-Type": "application/octet-stream",
        "Dropbox-API-Arg": json.dumps({"path": f"/Backups/backup-{date.today().isoformat()}.json", "mode": "overwrite"})},
        data=json.dumps(records).encode()).raise_for_status()
    entries = http.post("https://api.dropboxapi.com/2/files/list_folder", headers=auth, json={"path": "/Backups"}).json()["entries"]
    cutoff = datetime.now(timezone.utc) - timedelta(days=7)
    deleted = 0
    for e in entries:
        if e[".tag"] == "file" and datetime.fromisoformat(e["server_modified"].replace("Z", "+00:00")) < cutoff:
            http.post("https://api.dropboxapi.com/2/files/delete_v2", headers=auth, json={"path": e["path_lower"]}).raise_for_status()
            deleted += 1
    return {"uploaded": True, "deleted_old": deleted}

FAQ

Common questions

How many backups does it keep?
You choose the number, for example the latest 14 nightly files. Older ones are deleted automatically after each new upload, so the folder holds a fixed window of history and never grows beyond that, however long the job runs.
What kinds of data can it back up?
Anything it can fetch over an API or a URL, such as a table export, a JSON dump or a CSV report. It copies what that source returns, so the backup is only as complete as the export the source provides.
How do I restore from a backup?
You download the file you want from Dropbox and import it into the original system, using that system's own import tool. The automation handles taking and rotating the backups, not restoring them, so test an import once to be sure it works before you ever need it in an emergency.
What permissions does it need?
files.content.write. 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 “Back up to Dropbox and keep the last 7 days” from your assistant

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