Verify backup integrity by checking that files exist and checksums match.
backitup verify [BACKUP_ID...] [OPTIONS]
backitup verify --all [OPTIONS]| Option | Short | Description |
|---|---|---|
--config <path> |
-c |
Path to config file (default: ./backitup.config.yaml) |
--all |
Verify all active backups | |
--fix |
Update database for missing files | |
--force |
Skip confirmation when using --fix |
|
--verbose |
-v |
Enable verbose logging |
--help |
-h |
Show help message |
For each backup, verify checks:
- Local file exists - If local storage is configured
- S3 object exists - If S3 storage is configured
- Checksum matches - For local files, verifies SHA-256 checksum
# Verify specific backup by ID
backitup verify a1b2c3d4-e5f6-7890-abcd-ef1234567890
# Verify multiple backups
backitup verify abc123 def456 ghi789
# Verify all active backups
backitup verify --all# List backups with IDs
backitup list -v
# Get ID from JSON output
backitup list --format json | jq -r '.[0].backup_id'When backups have missing files, use --fix to update the database:
# Verify and fix (with confirmation)
backitup verify --all --fix
# Verify and fix without confirmation
backitup verify --all --fix --forceWhat --fix does:
- Marks backups with missing files as "deleted" in the database
- Does NOT delete any actual files
- Allows cleanup to properly account for missing backups
◆ backitup verify
│
◇ Verifying 5 backup(s)...
◇ Verification complete
│
✔ backitup_app_daily_2024-01-15_020000_abc123.tar.gz
✔ backitup_app_daily_2024-01-14_020000_def456.tar.gz
✔ backitup_app_daily_2024-01-13_020000_ghi789.tar.gz
✔ backitup-volume-postgres_data-daily-2024-01-15T02-00-00-000Z.tar.gz
✔ backitup-volume-postgres_data-daily-2024-01-14T02-00-00-000Z.tar.gz
│
│ ┌──────────────────────────────┐
│ │ Verified: 5 │
│ │ Healthy: 5 │
│ │ With issues: 0 │
│ │ Total issues: 0 │
│ └──────────────────────────────┘
│
◇ All backups verified!
◆ backitup verify
│
◇ Verifying 5 backup(s)...
◇ Verification complete
│
✔ backitup_app_daily_2024-01-15_020000_abc123.tar.gz
✖ backitup_app_daily_2024-01-14_020000_def456.tar.gz
│ • Local file missing: /backups/backitup_app_daily_2024-01-14_020000_def456.tar.gz
✖ backitup_app_daily_2024-01-13_020000_ghi789.tar.gz
│ • Checksum mismatch: expected abc123..., got def456...
✔ backitup-volume-postgres_data-daily-2024-01-15T02-00-00-000Z.tar.gz
✖ backitup-volume-postgres_data-daily-2024-01-14T02-00-00-000Z.tar.gz
│ • S3 object missing: s3://my-bucket/backups/backitup-volume-...
│
│ ┌──────────────────────────────┐
│ │ Verified: 5 │
│ │ Healthy: 2 │
│ │ With issues: 3 │
│ │ Total issues: 3 │
│ └──────────────────────────────┘
│
ℹ Run with --fix to update database for missing files
│
◇ Verification found issues
The backup file was deleted outside of BackItUp or moved.
Resolution:
- Run
--fixto update the database - Or restore the file from S3 if available
The S3 object was deleted or the bucket is inaccessible.
Resolution:
- Check S3 bucket permissions and credentials
- Run
--fixif the object was intentionally deleted
The file content doesn't match what was recorded.
Possible causes:
- File was modified after backup
- File corruption during storage/transfer
- Disk errors
Resolution:
- Investigate the cause
- Delete the corrupt backup and create a new one
# Weekly verification cron job
0 0 * * 0 /usr/local/bin/backitup verify --all# Verify backup before restoring
backitup verify abc123 && tar -xzf /backups/backup.tar.gz# Verify all backups after moving to new storage
backitup verify --all --fix --force