backup_export - OmniCloudOrg/OmniOrchestrator GitHub Wiki
Path: src/backup/export.rs
- struct BackupExporter
- fn new
- fn prepare_for_export
- fn archive_backup
- fn clean_old_backups
- fn remove_backup
- fn export_metadata_only
- fn merge_backups
pub struct BackupExporter {
temp_dir: PathBuf,
}
Provides functionality for exporting and archiving backups
pub fn new(temp_dir: impl Into<PathBuf>) -> Self {
Self {
// ... function body
}
Create a new BackupExporter instance
pub fn prepare_for_export(&self, backup: &Backup, export_path: &Path) -> Result<PathBuf> {
info!("Preparing backup for export: {}", backup.name);
Prepare backup for export or archiving
pub fn archive_backup(&self, backup: &Backup, archive_path: Option<&Path>) -> Result<PathBuf> {
info!("Archiving backup: {}", backup.name);
Archive a backup to a compressed file
pub fn clean_old_backups(&self, backup_ids: &[i32], retention_days: i64) -> Result<Vec<i32>> {
info!("Cleaning up old backups, retention period: {} days", retention_days);
Clean up older backups based on retention policy
pub fn remove_backup(&self, backup: &Backup) -> Result<()> {
info!("Removing backup: {}", backup.name);
Physically remove a backup from storage
pub fn export_metadata_only(&self, backup: &Backup, export_path: &Path) -> Result<PathBuf> {
info!("Exporting backup metadata only: {}", backup.name);
Export backup metadata only (no ISOs)
pub fn merge_backups(&self, backup_ids: &[i32], output_name: &str, storage_location: &Path) -> Result<PathBuf> {
info!("Merging {} backups into: {}", backup_ids.len(), output_name);
Merge multiple backups into a single comprehensive backup