Skip to content

Daily

Back up your data to a GitHub repo every night

Your exports and configs are committed to a private repo each night, only when something changed, with a summary by email.

Runs
Daily
Apps
GitHub
AI
Not needed
Access
Contents: read+write

Send this to your assistant

Create a ClickRuntime automation: every night at 2am, download the JSON export from https://api.example.com/export, save each item as a file in the backups/ folder of my private repo acme/backups, commit only files that changed, and email me what changed.

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

Many teams keep important configuration outside of version control: dashboard definitions, workflow exports, feature flag settings, CRM field lists or a database export from an internal tool. When someone edits one by mistake or a vendor changes defaults, there is no history to restore from. The only backup is a file on somebody's laptop from three months ago, if it exists at all.

Every night the export is downloaded over HTTP, and for each file the current version in your GitHub repository is read by its SHA and compared with the new content. Only files that changed are committed, so the git history reads as a log of real edits. An email summarizes what was updated.

It suits operations teams, consultants who manage client configurations and anyone who wants cheap, auditable backups using a repository they already have.

What you get out of it

  • Mistakes can be rolled back

    If a setting is edited wrongly on Tuesday, the previous night's file is in git, so restoring it takes minutes and does not depend on anyone's memory of what the old value was.

  • Git history becomes an audit trail

    Each commit shows what changed and on which night, which answers who-changed-what questions during incident reviews and compliance conversations without a separate logging system. That is valuable evidence for security reviews and customer questionnaires.

  • Quiet nights create no noise

    Because unchanged files are not committed, the repository does not fill with identical snapshots, and the commit list shows only genuine changes worth looking at. Fewer meaningless commits also make the history faster to review.

  • Backups live outside the source tool

    If the original service has an outage or an account is locked, your configurations still exist in GitHub, which is a different system with different failure modes. Independent copies are a basic principle of any sensible recovery plan.

  • The summary email is a daily change report

    The message listing updated files tells you at a glance whether anything moved overnight, so unexpected edits to critical settings get noticed the next morning. A surprise in that list is often the first clue that something changed.

How it works

What happens, step by step

  1. Every night, ClickRuntime downloads your data exports or config files.

  2. It compares each file with the copy already in your GitHub repo.

  3. Only files that changed are saved to the repo as a new version.

  4. You get an email listing the files that changed.

Before it runs live

  • Connect GitHub

What you get

RunsDaily
Back up your data to a GitHub repo every nighttoday, 9:00Succeeded
Email · Backup: 3 files changedbackups/cust_1042.json backups/cust_1077.json backups/cust_1101.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 GitHub 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.
scheduled_backup_of_data_into_a_repo.pyexample
import base64, json
from clickruntime import on_trigger, credentials, http, notify

def gh(method, path, **kw):
    resp = http.request(method, f"https://api.github.com{path}", headers={
        "Authorization": f"Bearer {credentials.connection('github', 'work')}",
        "Accept": "application/vnd.github+json"}, **kw)
    resp.raise_for_status()
    return resp.json() if resp.content else None

REPO = "acme/backups"

@on_trigger
def run(event):
    items = http.get("https://api.example.com/export").json()
    changed = []
    for item in items:
        path = f"backups/{item['id']}.json"
        content = json.dumps(item, indent=2, sort_keys=True) + "\n"
        r = http.get(f"https://api.github.com/repos/{REPO}/contents/{path}", headers={
            "Authorization": f"Bearer {credentials.connection('github', 'work')}", "Accept": "application/vnd.github+json"})
        current = r.json() if r.status_code == 200 else None
        if current and base64.b64decode(current["content"]).decode() == content:
            continue
        gh("PUT", f"/repos/{REPO}/contents/{path}", json={
            "message": f"Backup {path}", "content": base64.b64encode(content.encode()).decode(),
            **({"sha": current["sha"]} if current else {})})
        changed.append(path)
    if changed:
        notify.email_me(f"Backup: {len(changed)} files changed", "\n".join(changed))
    return {"items": len(items), "changed": len(changed)}

FAQ

Common questions

How does it avoid committing identical files every night?
For each file it reads the current version from the repository, including its SHA, and compares the content with the new download. If they match, nothing is committed for that file, so only real differences produce commits.
What kinds of data can it back up?
Anything an HTTP endpoint can return, such as JSON exports, CSV files or text configuration. Binary files are possible too but diff poorly. Keep secrets out of the repository, or use a private repo if the files contain sensitive values.
Can it write to a specific branch or folder?
Yes. You can specify the repository, branch and path for each file, for example a backups folder on a dedicated branch. Naming it differently per source keeps the history for each one separate and easy to browse.
What permissions does it need?
Contents: read+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 (daily). 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 your data to a GitHub repo every night” from your assistant

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