Implement CLI interface for the backup module with three subcommands:
- backup: create a backup and apply rotation
- list: list available backups
- restore: restore a specific backup
Also add __main__.py to enable 'python -m src.backup'.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Wraps temp file operations in try/except to ensure the temporary database file is always cleaned up, even if an exception occurs during write_snapshot or verify_integrity.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implémente les trois fonctions de gestion de snapshots SQLite:
- make_snapshot: crée un snapshot gzippé cohérent via sqlite3.Connection.backup()
- write_snapshot: écrit le snapshot décompressé à destination
- verify_integrity: valide l'intégrité d'une base avec PRAGMA integrity_check
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implémente la fonction select_retained() pour la rétention multi-paliers:
- Paliers fixes: horaire/12h, 12h/72h, quotidien/21j
- Palier mensuel: 12 mois calendaires
- Fonction pure, pas de dépendances sur d'autres modules backup
Fixes#89
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Ajoute les fonctions make_key() et parse_timestamp() pour gérer
le format des clés S3 avec horodatage UTC.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>