Automate GitHub Backups

Why automation beats cron

Shell scripts and git clone --mirror jobs work until they don’t—usually when GitHub rotates tokens, repositories rename, or metadata gets missed. Gitea Mirror bundles scheduling, auto-discovery, and repository cleanup so your backups keep running while you sleep.

Requirements

Step-by-step

1. Enable automatic syncing

  1. Go to Configuration → Automation.
  2. Toggle Automatic syncing on and choose an interval that matches your recovery point objective (start with 30 minutes for active teams, stretch to 12 hours for archives).
  3. Confirm the scheduler is running by checking the Last sync and Next sync timestamps in the Automation card.

2. Keep the repository list current

3. Configure repository cleanup (optional)

4. Monitor scheduler health

Gitea Mirror activity log displaying recent GitHub backup jobs and their status.

The Activity Log highlights successful syncs and failures so you can react before GitHub backups fall behind.

5. Harden credentials and runbooks

Validate automation

Best practices

FAQ

What replaces my cron scripts?

The built-in scheduler handles intervals, retries, and discovery. It also powers cleanup for deleted upstream repos (Archive/Delete) once enabled.

How do I get alerts if backups fail?

Monitor /api/health with Healthchecks.io or Uptime Kuma and review the Activity Log. You can export failures via /api/events for centralized logging.

Will new repositories be discovered automatically?

Yes. After importing your GitHub data once, the scheduler’s discovery step keeps the inventory updated and mirrors new repositories on the next run.