-
Notifications
You must be signed in to change notification settings - Fork 0
Snapshots & Recovery
Snapshots are the primary recovery mechanism in GitBack. A snapshot captures the current backup state and stores it as a compressed archive suitable for long-term retention and off-site storage.
Create a snapshot:
gitback snapshotForce snapshot creation even if previous synchronization failures exist:
gitback snapshot --forceEach snapshot contains:
mirrors/
state/
The mirrors directory contains Git repositories and Gists.
mirrors/
├── repositories/
└── gists/
The state directory contains inventory and synchronization state.
state/
├── repositories.txt
├── gists.txt
└── mirrors.json
Together these files provide enough information to inspect and recover a backup.
Snapshots are stored as:
YYYY-MM-DDTHH-MM-SSZ.tar.zst
Example:
2026-06-17T14-30-00Z.tar.zst
GitBack uses:
- tar for archive creation
- zstd for compression
No proprietary formats are used.
GitBack generates a SHA256 checksum alongside every snapshot.
Example:
2026-06-17T14-30-00Z.tar.zst
2026-06-17T14-30-00Z.tar.zst.sha256
Verify integrity:
sha256sum -c 2026-06-17T14-30-00Z.tar.zst.sha256Expected result:
2026-06-17T14-30-00Z.tar.zst: OK
Always verify checksums after transferring snapshots to another system or storage provider.
GitBack can automatically remove older snapshots.
Configuration:
snapshot_retention: 30Behavior:
Keep newest 30 snapshots
Delete older snapshots
Retention is disabled by default:
snapshot_retention: 0Extract a snapshot:
tar --zstd -xf 2026-06-17T14-30-00Z.tar.zstResult:
mirrors/
state/
The extracted mirrors can be inspected using standard Git tools.
Example:
git --git-dir mirrors/repositories/FlareXes/gitback.git log --onelineNo GitBack-specific tooling is required to access backup data.
If the local GitBack data directory is lost:
- Restore the latest snapshot.
- Extract the archive.
- Place the restored files under the GitBack data directory.
- Run:
gitback health- Run:
gitback syncto update mirrors from GitHub.
Snapshots are designed to be copied elsewhere.
Common destinations:
- External drives
- NAS devices
- Object storage
- Backup servers
- Cloud storage
A backup stored only on the same machine is not a complete backup strategy.
Backups should be tested periodically.
Recommended procedure:
- Select a recent snapshot.
- Verify the checksum.
- Extract the archive.
- Inspect several repositories.
- Confirm commit history is present.
Example:
git --git-dir mirrors/repositories/FlareXes/gitback.git show HEADA backup is only valuable if recovery has been tested.
Yes.
GitBack stores standard Git mirrors.
Use standard Git commands against the mirrored repositories.
Yes.
Snapshots are standard tar archives compressed with zstd.
Yes.
Set:
snapshot_retention: 0to disable automatic cleanup.
Continue with: