-
Notifications
You must be signed in to change notification settings - Fork 0
Automation
GitBack is designed to run unattended using standard schedulers such as cron, systemd timers, or CI/CD pipelines.
A typical backup workflow consists of:
gitback discover
gitback sync
gitback snapshot --forceMost environments do not require continuous discovery.
A common approach is:
Discover Daily
Sync Hourly
Snapshot Daily
Health Daily
Example:
02:00 discover
02:15 sync
03:00 snapshot --force
03:15 health
Adjust schedules based on repository activity and recovery requirements.
Example cron schedule:
0 2 * * * gitback discover
15 2 * * * gitback sync
0 3 * * * gitback snapshot --force
15 3 * * * gitback healthThis:
- Refreshes repository and Gist inventories
- Synchronizes mirrors
- Creates a daily snapshot
- Produces a health report
Example service:
[Unit]
Description=GitBack Sync
[Service]
Type=oneshot
ExecStart=/usr/local/bin/gitback syncExample timer:
[Unit]
Description=Run GitBack Sync
[Timer]
OnCalendar=hourly
Persistent=true
[Install]
WantedBy=timers.targetEnable:
systemctl enable --now gitback-sync.timerGitBack can also run from:
- GitHub Actions
- GitLab CI
- Jenkins
- Buildkite
- Other CI/CD systems
Example workflow:
gitback discover
gitback sync
gitback snapshot --forceStore snapshots on persistent storage rather than ephemeral runners.
Regularly review:
gitback healthMonitor for:
- Failed repositories
- Failed Gists
- Low disk space
- Snapshot retention warnings
Health reports are intended to provide early warning before backups become unusable.
GitBack produces structured JSON logs.
Default location:
~/.local/state/gitback/gitback.log
Logs can be:
- Forwarded to a log collector
- Monitored by systemd
- Parsed by automation tools
- Used during troubleshooting
GitBack automatically recreates missing runtime directories:
mirrors/
snapshots/
state/
tmp/
Recovery events are logged and backup operations continue when possible.
This allows scheduled jobs to recover from accidental directory deletion without manual intervention.
For most users:
- Run discover daily
- Run sync at least daily
- Run snapshot after sync
- Enable snapshot retention
- Monitor health reports
- Store snapshots on separate storage
Backups are only useful if they can be restored. Periodically verify snapshot integrity and recovery procedures.
Continue with: