feat(backup): Add backup scheduling system with GFS retention, API and UI integration

This commit is contained in:
2025-11-27 21:42:07 +00:00
parent c5d239ab28
commit 6ba7e655e3
17 changed files with 2319 additions and 12 deletions

View File

@@ -22,6 +22,8 @@ import type {
IRestoreResult,
TPlatformServiceType,
IPlatformResource,
IBackupCreateOptions,
TRetentionTier,
} from '../types.ts';
import { logger } from '../logging.ts';
import { getErrorMessage } from '../utils/error.ts';
@@ -45,8 +47,10 @@ export class BackupManager {
/**
* Create a backup for a service
* @param serviceName - Name of the service to backup
* @param options - Optional backup creation options (scheduleId)
*/
async createBackup(serviceName: string): Promise<IBackupResult> {
async createBackup(serviceName: string, options?: IBackupCreateOptions): Promise<IBackupResult> {
const service = this.oneboxRef.database.getServiceByName(serviceName);
if (!service) {
throw new Error(`Service not found: ${serviceName}`);
@@ -181,6 +185,7 @@ export class BackupManager {
includesImage: includeImage,
platformResources: resourceTypes,
checksum,
scheduleId: options?.scheduleId,
};
const createdBackup = this.oneboxRef.database.createBackup(backup);