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.
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
Every night, ClickRuntime fetches the data you want backed up.
It saves it to your Dropbox backups folder as a file with today's date in the name.
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
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 Dropbox steps into one automation
Under the hood
The code that runs this automation
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?
What kinds of data can it back up?
How do I restore from a backup?
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
Save a converted data feed to Dropbox nightly
A file from a URL is downloaded, converted or zipped, saved to Dropbox and sent to you as a share link.
See how it worksClear out old exports automatically
Files of the type you name are deleted once they pass the age you set, and you get a count.
See how it worksGet warned before shared links expire
Each morning you see which of your Dropbox share links run out within the week.
See how it worksKeep exploring
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.