Skip to content

A modern, self-hosted backup solution for secure, encrypted backups across local and cloud storage.

chore: removes dev logging

towfiqi86e7fb880803
diff --git a/backend/src/controllers/PlanController.ts b/backend/src/controllers/PlanController.ts
index 713d174..b29fa92 100644
--- a/backend/src/controllers/PlanController.ts
+++ b/backend/src/controllers/PlanController.ts
@@ -68,7 +68,7 @@ export class PlanController {
async createPlan(req: Request, res: Response): Promise<void> {
const planPayload: undefined | NewPlanReq = req.body;
- console.log('planPayload :', planPayload);
+
try {
if (
!planPayload ||
diff --git a/backend/src/index.ts b/backend/src/index.ts
index 0985f52..b183bdc 100644
--- a/backend/src/index.ts
+++ b/backend/src/index.ts
@@ -32,18 +32,18 @@ if (isMainModule || isDevelopment) {
// For binary installations on Windows/macOS, try to load credentials from keyring
if (requiresKeyringSetup() && configService.isSetupPending()) {
- console.log('[CORE] Attempting to load credentials from system keyring...');
+ console.log('Attempting to load credentials from system keyring...');
const loaded = await ConfigService.reinitializeWithKeyringCredentials();
if (loaded) {
- console.log('[CORE] Credentials loaded from keyring successfully.');
+ console.log('Credentials loaded from keyring successfully.');
} else {
- console.log('[CORE] No credentials found in keyring. Waiting for initial setup...');
+ console.log('No credentials found in keyring. Waiting for initial setup...');
}
}
// Run database migrations first
if (process.env.NODE_ENV === 'production') {
- console.log('[CORE] Running database migrations...');
+ console.log('Running database migrations...');
try {
const migrationsFolder =
process.env.IS_DOCKER === 'true'
@@ -53,10 +53,10 @@ if (isMainModule || isDevelopment) {
// Check if migrations exist
const journalPath = path.join(migrationsFolder, 'meta', '_journal.json');
if (!fs.existsSync(journalPath)) {
- console.log('[CORE] No migrations found (meta/_journal.json missing), skipping...');
+ console.log('No migrations found (meta/_journal.json missing), skipping...');
} else {
migrate(db, { migrationsFolder });
- console.log('[CORE] Database migrations completed successfully');
+ console.log('Database migrations completed successfully');
}
} catch (error: any) {
// If tables already exist or columns already exist (edition upgrade) - skip migration
@@ -65,9 +65,9 @@ if (isMainModule || isDevelopment) {
(error?.cause?.message?.includes('already exists') ||
error?.cause?.message?.includes('duplicate column'))
) {
- console.log('[CORE] Database schema already up-to-date, skipping migrations');
+ console.log('Database schema already up-to-date, skipping migrations');
} else {
- console.error('[CORE] Database migration error:', error);
+ console.error('Database migration error:', error);
process.exit(1);
}
}
@@ -77,38 +77,38 @@ if (isMainModule || isDevelopment) {
if (!configService.isSetupPending()) {
await initSetup(db as unknown as BetterSQLite3Database);
} else {
- console.log('[CORE] Setup pending - skipping initSetup. Complete setup via web interface.');
+ console.log('Setup pending - skipping initSetup. Complete setup via web interface.');
}
const { app } = await createApp();
const server = app.listen(configService.config.SERVER_PORT || 5173, () => {
- console.log(`[CORE] Server running on port ${configService.config.SERVER_PORT || 5173}`);
+ console.log(`Server running on port ${configService.config.SERVER_PORT || 5173}`);
if (configService.isSetupPending()) {
console.log(
- `[CORE] ⚠️ Initial setup required. Visit http://localhost:${configService.config.SERVER_PORT || 5173} to complete setup.`
+ `⚠️ Initial setup required. Visit http://localhost:${configService.config.SERVER_PORT || 5173} to complete setup.`
);
}
});
// Graceful shutdown handling for Docker
process.on('SIGTERM', async () => {
- console.log('[CORE] SIGTERM received, shutting down gracefully...');
+ console.log('SIGTERM received, shutting down gracefully...');
const forceExit = setTimeout(() => {
process.exit(1);
}, 30000); // 30 seconds timeout
server.close(() => {
clearTimeout(forceExit);
- console.log('[CORE] Server closed');
+ console.log('Server closed');
process.exit(0);
});
});
process.on('SIGINT', async () => {
- console.log('[CORE] SIGINT received, shutting down gracefully...');
+ console.log('SIGINT received, shutting down gracefully...');
server.close(() => {
- console.log('[CORE] Server closed');
+ console.log('Server closed');
process.exit(0);
});
});
diff --git a/backend/src/jobs/JobQueue.ts b/backend/src/jobs/JobQueue.ts
index cd826e8..54ba4c5 100644
--- a/backend/src/jobs/JobQueue.ts
+++ b/backend/src/jobs/JobQueue.ts
@@ -119,12 +119,6 @@ class JobQueue {
(this.runningJob?.name === jobName &&
JSON.stringify(this.runningJob?.payload) === JSON.stringify(payload));
- // === DEBUG LOGGING START ===
- console.log(
- `[DEBUG_QUEUE] Adding job '${jobName}'. Payload: ${JSON.stringify(payload)}. Is duplicate? ${isPresent}`
- );
- // === DEBUG LOGGING END ===
-
if (isPresent) {
return;
}
diff --git a/backend/src/managers/BaseBackupManager.ts b/backend/src/managers/BaseBackupManager.ts
index f3c048a..a040d21 100644
--- a/backend/src/managers/BaseBackupManager.ts
+++ b/backend/src/managers/BaseBackupManager.ts
@@ -80,7 +80,7 @@ export class BaseBackupManager extends EventEmitter {
RCLONE_CONFIG_PASS: repoPassword,
});
} catch (error: any) {
- // console.log('[BaseBackupManager] repo Creation Error :', error);
+ console.warn('[createBackup] repo Creation Error :', error);
return { success: false, result: 'Could Not Create Restic Repo. Details: ' + error.message };
}
@@ -115,7 +115,6 @@ export class BaseBackupManager extends EventEmitter {
}
async queueBackup(planId: string, options: Record<string, any>): Promise<any> {
- // console.log('BaseBackupManager->queueBackup :', options);
if (options && !options.isActive) {
return; // Return to satisfy the Promise<any> signature
}
@@ -145,7 +144,6 @@ export class BaseBackupManager extends EventEmitter {
'purge',
`${options.storageName}:${options.storagePath}`,
]);
- console.log('rclone removeResult :', output);
removeResult += output;
}
@@ -157,7 +155,6 @@ export class BaseBackupManager extends EventEmitter {
'purge',
`${replica.storageName}:${replica.storagePath}`,
]);
- console.log(`rclone replication removeResult (${replica.storageName}):`, output);
removeResult += ` | Replication ${replica.storageName}: ${output}`;
} catch (error: any) {
// Log but don't fail the entire removal if a replication storage purge fails
@@ -200,7 +197,6 @@ export class BaseBackupManager extends EventEmitter {
backupId: string,
retryInfo: { attempts: number; maxAttempts: number }
): Promise<string> {
- console.log('[BaseBackupManager] ❎ Performing backup execution:');
// Retrieve the schedule and its options from the CronManager
const schedules = await this.cronManager.getSchedule(planId);
const backupSchedule = schedules?.find(s => s.type === 'backup');
@@ -297,7 +293,6 @@ export class BaseBackupManager extends EventEmitter {
'purge',
`${options.storageName}:${options.storagePath}`,
]);
- console.log(`rclone replication purge (${options.storageName}):`, output);
result += ` Data purged: ${output}`;
}
@@ -392,8 +387,6 @@ export class BaseBackupManager extends EventEmitter {
}
try {
- console.log(`[BaseBackupManager]: Force-unlocking repository for plan: ${planId}`);
-
const repoPath = generateResticRepoPath(options.storage.name, options.storagePath || '');
const repoPassword = options.settings.encryption ? encKey : '';
// Run the restic unlock command on the primary repo
@@ -469,7 +462,7 @@ export class BaseBackupManager extends EventEmitter {
this.queueBackup(id, opts);
},
};
- console.log('[CORE] action :', action);
+
if (action === 'create') {
await this.cronManager.scheduleTask(planId, cronExpression, backupOptions, 'backup');
} else {
@@ -485,20 +478,12 @@ export class BaseBackupManager extends EventEmitter {
}
async updatePlanStorageName(storageId: string, newStorageName: string) {
- console.log('updatePlanStorageName :', storageId, newStorageName);
try {
- // Load schedules.json content
- // await this.cronManager.loadSchedules();
-
// Get all schedules and iterate through each plan
const schedules = await this.cronManager.getSchedules();
- console.log('schedules :', schedules);
if (schedules) {
for (const [planId, scheduleEntries] of Object.entries(schedules)) {
const backupSchedule = scheduleEntries.find((s: any) => s.type === 'backup');
-
- console.log('Found Schedule :', backupSchedule);
-
// Check if this backup schedule uses the storage we want to update
if (backupSchedule?.options.storageId === storageId) {
const updatedOptions = {
diff --git a/backend/src/managers/BaseSnapshotManager.ts b/backend/src/managers/BaseSnapshotManager.ts
index 2912d96..2a06fae 100644
--- a/backend/src/managers/BaseSnapshotManager.ts
+++ b/backend/src/managers/BaseSnapshotManager.ts
@@ -132,7 +132,6 @@ export class BaseSnapshotManager extends EventEmitter {
RESTIC_PASSWORD: repoPassword,
});
removalOutput[repo.id] = output;
- console.log('[removeSnapshot] restic output:', output);
const repoStats = await getBackupPlanStats(planId, repo.name, repo.path, encryption);
if (repo.id === 'primary') {
planStats.primary = repoStats || { total_size: 0, snapshots: [] };
diff --git a/backend/src/managers/BaseStorageManager.ts b/backend/src/managers/BaseStorageManager.ts
index 01f932c..58ac44e 100644
--- a/backend/src/managers/BaseStorageManager.ts
+++ b/backend/src/managers/BaseStorageManager.ts
@@ -47,7 +47,6 @@ export class BaseStorageManager {
// Workaround for Rclone Onedrive Bug:
// https://forum.rclone.org/t/rclone-config-create-miss-some-info-and-doesnt-work-as-expect/21045
const oneDriveCreds = JSON.parse(credentials.token);
- console.log('[rclone] fetch onedrive drive_id & drive_type');
const myHeaders = new Headers();
myHeaders.append('Authorization', oneDriveCreds.access_token);
@@ -64,6 +63,7 @@ export class BaseStorageManager {
}
});
} catch (error: any) {
+ console.warn('[error] fetch onedrive drive_id & drive_type', error?.message || error);
return {
success: false,
result:
diff --git a/backend/src/managers/CronManager.ts b/backend/src/managers/CronManager.ts
index d61aea1..eed45ee 100644
--- a/backend/src/managers/CronManager.ts
+++ b/backend/src/managers/CronManager.ts
@@ -98,8 +98,6 @@ export class CronManager<T extends ScheduleOptions> {
options: T,
scheduleType: string
): Promise<void> {
- console.log('[scheduleTask] :', id, scheduleType, cronExpression);
-
const existingSchedules = this.schedules.get(id) || [];
// Check if a schedule with the same type already exists
diff --git a/backend/src/managers/handlers/BackupHandler.ts b/backend/src/managers/handlers/BackupHandler.ts
index 0dc4314..4ca5b2d 100644
--- a/backend/src/managers/handlers/BackupHandler.ts
+++ b/backend/src/managers/handlers/BackupHandler.ts
@@ -185,7 +185,6 @@ export class BackupHandler {
// Run post-failure scripts.
if (permanentlyFailed) {
- console.log('### Final Attempt!!! Running Scripts...');
await this.afterBackupFailure(planId, backupId, options);
await this.afterBackup(planId, backupId, options);
} else {
@@ -647,7 +646,6 @@ export class BackupHandler {
const outputLines = dryRunOutput.split('\n');
const summaryLine = outputLines[outputLines.length - 1];
const dryRunSummary = JSON.parse(summaryLine);
- console.log('dryRunBackup :', dryRunSummary);
return dryRunSummary;
} catch (error: any) {
console.error('[dryRunBackup]: Failed', error.message);
diff --git a/backend/src/managers/handlers/ReplicationHandler.ts b/backend/src/managers/handlers/ReplicationHandler.ts
index b223902..a4c4b6f 100644
--- a/backend/src/managers/handlers/ReplicationHandler.ts
+++ b/backend/src/managers/handlers/ReplicationHandler.ts
@@ -319,8 +319,8 @@ export class ReplicationHandler {
.updateReplicationResticProgress(planId, backupId, replicationId, line)
.catch(() => {});
},
- (data: Buffer) => {
- console.log('### Restic Copy Error :', data.toString());
+ (_: Buffer) => {
+ // console.log('### Restic Copy Error :', data.toString());
},
undefined,
process => {
diff --git a/backend/src/managers/handlers/RestoreHandler.ts b/backend/src/managers/handlers/RestoreHandler.ts
index b3213bc..8f4245a 100644
--- a/backend/src/managers/handlers/RestoreHandler.ts
+++ b/backend/src/managers/handlers/RestoreHandler.ts
@@ -352,9 +352,9 @@ export class RestoreHandler {
const sourceItemInTempDir = path.join(winRestorePath, driveLetter, relativePath);
const destinationPath = sourcePath;
+ console.log('Copying files from', sourceItemInTempDir, 'to', destinationPath);
// Verify the item exists in the temp directory before trying to copy
await access(sourceItemInTempDir, constants.F_OK);
- console.log('Copying files from', sourceItemInTempDir, 'to', destinationPath);
await copyFilesNatively(sourceItemInTempDir, destinationPath, overwrite);
} catch (error: any) {
console.log('Error occurred while copying files:', error);
@@ -649,7 +649,6 @@ export class RestoreHandler {
options: { storageName: string; storagePath: string; encryption: boolean }
): Promise<void> {
if (options.storageName && options.storagePath) {
- console.log(`[RestoreHandler]: Unlocking stale locks for plan: ${planId}`);
try {
const repoPath = generateResticRepoPath(options.storageName, options.storagePath || '');
const repoPassword = options.encryption ? configService.config.ENCRYPTION_KEY : '';
diff --git a/backend/src/services/BackupServices.ts b/backend/src/services/BackupServices.ts
index bd40b64..4357c97 100644
--- a/backend/src/services/BackupServices.ts
+++ b/backend/src/services/BackupServices.ts
@@ -62,10 +62,6 @@ export class BackupService {
// If snapshot removal fails, it should not throw an error
// Because the snapshot might have been removed already by prune process
- console.log('Snapshot Remove Result :', removeResult?.result);
- // if (!removeResult.success) {
- // throw new Error(removeResult.result || 'Failed to remove Snapshot');
- // }
if (removeResult.stats) {
const primaryStats = removeResult.stats.primary;
@@ -163,7 +159,6 @@ export class BackupService {
}
async cancelBackup(planId: string, backupId: string) {
- console.log('cancelBackup :', planId, backupId);
const backup = await this.backupStore.getById(backupId);
if (!backup) {
throw new Error('Backup not found');
@@ -184,7 +179,6 @@ export class BackupService {
jobQueue.remove('RescueBackup', planId); // for Server Rescue jobs
}
- console.log('#### Backup cancelled:', backupId);
await this.backupStore.update(backup.id, {
status: 'cancelled',
inProgress: false,
diff --git a/backend/src/services/DeviceService.ts b/backend/src/services/DeviceService.ts
index 591f7f2..2b7d0ff 100644
--- a/backend/src/services/DeviceService.ts
+++ b/backend/src/services/DeviceService.ts
@@ -107,7 +107,7 @@ export class DeviceService {
storages: deviceStorages,
};
} catch (error: any) {
- console.log('🎃Error fetching device metrics:', error);
+ console.log('Error fetching device metrics:', error?.message || error);
DeviceLogger(id).error(
`Error fetching device data for #${id}. Reason : ${error?.message.toString() || 'Unknown Error'}`
);
diff --git a/backend/src/services/KeyringService.ts b/backend/src/services/KeyringService.ts
index a2c7649..391fc0f 100644
--- a/backend/src/services/KeyringService.ts
+++ b/backend/src/services/KeyringService.ts
@@ -220,7 +220,6 @@ class KeyringService {
try {
const entry = new this.Entry(SERVICE_NAME, key);
entry.deletePassword();
- console.log(`[KeyringService] Credential '${key}' deleted successfully`);
return true;
} catch (error) {
console.error(`[KeyringService] Failed to delete credential '${key}':`, error);
diff --git a/backend/src/services/PlanService.ts b/backend/src/services/PlanService.ts
index 2788da0..ef0113b 100644
--- a/backend/src/services/PlanService.ts
+++ b/backend/src/services/PlanService.ts
@@ -141,11 +141,10 @@ export class PlanService {
storage: planStorage,
cronExpression,
};
- // console.log('backupScheduleOptions :', backupScheduleOptions);
+
try {
const strategy = this.getStrategy(newPlanData) as BackupStrategy;
const creationRes = await strategy.createBackup(planId, backupScheduleOptions);
- console.log('creationRes :', creationRes);
if (!creationRes.success) {
throw new AppError(500, creationRes.result);
}
@@ -175,14 +174,12 @@ export class PlanService {
throw new NotFoundError('Plan not found.');
}
let parsedPlanData;
- // console.log('[PlanService] planData :', planData);
try {
const parsedData = planUpdateSchema.parse(planData);
parsedPlanData = {
...parsedData,
sourceType: (parsedData.sourceType || currentPlan.sourceType) as SourceTypes,
};
- // console.log('[PlanService] parsedPlanData :', parsedPlanData);
} catch (error) {
console.error('Error parsing plan data:', error);
throw error;
diff --git a/backend/src/services/RestoreService.ts b/backend/src/services/RestoreService.ts
index 00df777..58b5be2 100644
--- a/backend/src/services/RestoreService.ts
+++ b/backend/src/services/RestoreService.ts
@@ -107,7 +107,7 @@ export class RestoreService {
delete: restoreConfig.delete,
includes: restoreConfig.includes,
excludes: restoreConfig.excludes,
- replicationId: restoreConfig.replicationId,
+ replicationId: restoreConfig.replicationId,
}
);
@@ -189,7 +189,6 @@ export class RestoreService {
}
const strategy = this.getRestoreStrategy(restore.sourceId as string, restore.method);
const cancelResult = await strategy.cancelSnapshotRestore(restore.planId as string, restoreId);
- console.log('cancelResult :', cancelResult);
await this.restoreStore.update(restoreId, {
status: 'cancelled',
inProgress: false,
diff --git a/backend/src/services/SettingsService.ts b/backend/src/services/SettingsService.ts
index 5447186..6f0acf4 100644
--- a/backend/src/services/SettingsService.ts
+++ b/backend/src/services/SettingsService.ts
@@ -37,7 +37,7 @@ export class SettingsService {
const parsedSettingsEntry = settingsUpdateSchema
.partial()
.parse({ settings: parsedSettings });
- console.log('#### parsedSettingsEntry :', parsedSettingsEntry);
+
parsedSettings = parsedSettingsEntry.settings as AppSettings;
} catch (error) {
console.error('Error parsing settings data:', error);
@@ -88,8 +88,6 @@ export class SettingsService {
const sendRes = await senderChannel.send(notificationClass, {
emails: test.email,
});
- // console.log('senderChannel :', senderChannel);
- // console.log('sendRes :', integrationType, sendRes);
// Set the integration status to connected
if (sendRes.success) {
diff --git a/backend/src/services/events/BackupEventService.ts b/backend/src/services/events/BackupEventService.ts
index ef7d6cb..32bd51d 100644
--- a/backend/src/services/events/BackupEventService.ts
+++ b/backend/src/services/events/BackupEventService.ts
@@ -35,17 +35,12 @@ export class BackupEventService {
}
async onBackupStart(data: BackupStartEvent): Promise<void> {
- console.log('onBackupStart: ', data);
const { planId, backupId, summary } = data;
if (!planId) {
return;
}
const existingBackup = await this.backupStore.getById(backupId);
- console.log(
- 'existingBackup :',
- existingBackup ? existingBackup.id : 'No existing backup found'
- );
if (existingBackup && existingBackup.sourceId === 'main' && this.localAgent) {
// This is a RETRY. Re-initialize the state for the new attempt.
await this.backupStore.update(backupId, {
@@ -59,7 +54,6 @@ export class BackupEventService {
}
const activeBackups = await this.planStore.hasActiveBackups(planId);
- console.log('activeBackups :', activeBackups);
if (activeBackups) {
planLogger('backup', planId).error(
`Failed to Start Backup as a backup is already running for this plan.`
@@ -151,7 +145,6 @@ export class BackupEventService {
}
async onBackupComplete(data: BackupCompleteEvent): Promise<void> {
- console.log('onBackupComplete: ', data);
const { planId, success, backupId, summary } = data;
const progressFile = `${this.progressDir}/backup-${backupId}.json`;
let summaryData: any = null;
@@ -237,7 +230,6 @@ export class BackupEventService {
}
async onBackupError(data: BackupErrorEvent): Promise<void> {
- console.log('onBackupError: ', data);
try {
// Update DB with Error
const backup = await this.backupStore.update(data.backupId, {
@@ -262,7 +254,6 @@ export class BackupEventService {
}
async onBackupFailure(data: { planId: string; backupId: string; error: string }): Promise<void> {
- console.log('########## onBackupFailure: ', data);
const { planId, backupId, error } = data;
try {
// Update DB with Error
@@ -305,7 +296,6 @@ export class BackupEventService {
}
async onBackupStatsUpdate(data: BackupStatUpdateEvent) {
- console.log('onBackupStatsUpdate :', data);
const { total_size, snapshots = [], backupId, planId, error = '', mirrors } = data;
if (planId && total_size && !Number.isNaN(total_size) && snapshots.length > 0) {
try {
@@ -337,7 +327,6 @@ export class BackupEventService {
}
async onPruneEnd(data: PruneEndEvent): Promise<void> {
- console.log('onPruneEnd :', data);
if (data.success) {
planLogger('prune', data.planId).info(`Successfully pruned Backups.`);
const { planId, stats } = data;
@@ -412,7 +401,6 @@ export class BackupEventService {
}
async onIntegrityStart(data: { planId: string }) {
- console.log('onIntegrityStart :', data);
const startedAt = new Date().getTime();
try {
await this.planStore.update(data.planId, {
@@ -434,7 +422,6 @@ export class BackupEventService {
}
async onIntegrityEnd(data: { planId: string; result: Record<string, string | null> }) {
- console.log('onIntegrityEnd :', data);
const endedAt = new Date().getTime();
try {
const thePlan = await this.planStore.getById(data.planId);
@@ -493,7 +480,6 @@ export class BackupEventService {
}
async onIntegrityFailed(data: { planId: string; error: string }) {
- console.log('onIntegrityFailed :', data);
const thePlan = await this.planStore.getById(data.planId);
if (thePlan && thePlan.storage?.name && thePlan.device?.id) {
planLogger('integrity_check', data.planId).error(`Failed Integrity Check for Backup Plan.`);
diff --git a/backend/src/services/events/DownloadEventService.ts b/backend/src/services/events/DownloadEventService.ts
index 21f2501..b253d46 100644
--- a/backend/src/services/events/DownloadEventService.ts
+++ b/backend/src/services/events/DownloadEventService.ts
@@ -12,7 +12,6 @@ export class DownloadEventService {
async onDownloadStart(eventPayload: DownloadStartEvent) {
const { backupId, planId } = eventPayload;
try {
- console.log('onDownloadStart :', eventPayload);
const currentTime = Math.floor(new Date().getTime() / 1000);
await this.backupStore.update(backupId, {
download: {
@@ -34,7 +33,6 @@ export class DownloadEventService {
async onDownloadError(eventPayload: DownloadErrorEvent) {
const { backupId, planId, error } = eventPayload;
try {
- console.log('onDownloadError :', eventPayload);
const backup = await this.backupStore.getById(backupId);
await this.backupStore.update(backupId, {
download: {
@@ -59,8 +57,6 @@ export class DownloadEventService {
async onDownloadComplete(eventPayload: DownloadCompleteEvent) {
const { backupId, planId, success } = eventPayload;
try {
- console.log('onDownloadComplete :', eventPayload);
-
const backup = await this.backupStore.getById(backupId);
await this.backupStore.update(backupId, {
download: {
diff --git a/backend/src/services/events/RestoreEventService.ts b/backend/src/services/events/RestoreEventService.ts
index 1ca48b3..8d263af 100644
--- a/backend/src/services/events/RestoreEventService.ts
+++ b/backend/src/services/events/RestoreEventService.ts
@@ -19,7 +19,6 @@ export class RestoreEventService {
) {}
async onRestoreStart(data: RestoreStartEvent) {
- console.log('onRestoreStart :', data);
try {
const { planId, backupId, restoreId, config, stats } = data;
@@ -94,7 +93,6 @@ export class RestoreEventService {
async onRestoreError(eventPayload: RestoreErrorEvent) {
const { backupId, restoreId, planId, error } = eventPayload;
if (!backupId || !planId || !error) {
- console.log('[onRestoreError] Invalid restore error event data:', eventPayload);
return;
}
try {
@@ -120,7 +118,6 @@ export class RestoreEventService {
async onRestoreFailed(eventPayload: RestoreErrorEvent) {
const { backupId, restoreId, planId, error } = eventPayload;
if (!backupId || !planId || !restoreId || !error) {
- console.log('[onRestoreFailed] Invalid restore complete event data:', eventPayload);
return;
}
try {
@@ -144,10 +141,8 @@ export class RestoreEventService {
}
async onRestoreComplete(eventPayload: RestoreCompleteEvent) {
- console.log('onRestoreComplete :', eventPayload);
const { backupId, restoreId, planId, success } = eventPayload;
if (!backupId || !planId || !restoreId || success === undefined) {
- console.log('[onRestoreComplete] Invalid restore complete event data:', eventPayload);
return;
}
try {
@@ -165,8 +160,6 @@ export class RestoreEventService {
completionStats: progressData?.data,
});
- console.log('[onRestoreComplete] After Restore Db Write!');
-
// if (existsSync(progressFile)) {
// await unlink(progressFile);
// }
diff --git a/backend/src/services/listeners/BackupEventListener.ts b/backend/src/services/listeners/BackupEventListener.ts
index 75358d7..184c435 100644
--- a/backend/src/services/listeners/BackupEventListener.ts
+++ b/backend/src/services/listeners/BackupEventListener.ts
@@ -95,16 +95,7 @@ export class BackupEventListener {
await this.backupEventService.onBackupFailure(data);
}
- // protected async onBackupProgress(data: BackupProgressEvent) {
- // console.log('onBackupProgress :', data);
- // try {
- // const progressFile = `${this.progressDir}/backup-${data.backupId}-progress.json`;
- // await writeFile(progressFile, JSON.stringify(data));
- // } catch (error: any) {}
- // }
-
protected async onBackupStatsUpdate(data: BackupStatUpdateEvent) {
- console.log('[BackupEventListener] onBackupStatsUpdate :', data);
await this.backupEventService.onBackupStatsUpdate(data);
}
@@ -127,17 +118,14 @@ export class BackupEventListener {
}
async onIntegrityStart(data: { planId: string }) {
- console.log('onIntegrityStart :', data);
await this.backupEventService.onIntegrityStart(data);
}
async onIntegrityEnd(data: { planId: string; result: Record<string, string | null> }) {
- console.log('onIntegrityEnd :', data);
await this.backupEventService.onIntegrityEnd(data);
}
async onIntegrityCheckFailure(data: { planId: string; error: string }) {
- console.log('onIntegrityCheckFailure :', data);
await this.backupEventService.onIntegrityFailed(data);
}
}
diff --git a/backend/src/services/listeners/DownloadEventListener.ts b/backend/src/services/listeners/DownloadEventListener.ts
index c6a065f..d1826ea 100644
--- a/backend/src/services/listeners/DownloadEventListener.ts
+++ b/backend/src/services/listeners/DownloadEventListener.ts
@@ -34,17 +34,6 @@ export class DownloadEventListener {
await this.downloadEventService.onDownloadStart(eventPayload);
}
- // private async onDownloadProgress(eventPayload: DownloadProgressEvent) {
- // const { backupId, planId, error } = eventPayload;
- // try {
- // console.log('onDownloadProgress :', data);
- // const progressFile = `${appPaths.getProgressDir()}/download-${data.backupId}-progress.json`;
- // await writeFile(progressFile, JSON.stringify(data));
- // } catch (error: any) {
- // console.log('[onDownloadProgress] error :', error);
- // }
- // }
-
private async onDownloadError(eventPayload: DownloadErrorEvent) {
await this.downloadEventService.onDownloadError(eventPayload);
}
diff --git a/backend/src/services/listeners/RestoreEventListener.ts b/backend/src/services/listeners/RestoreEventListener.ts
index 8841c92..7784548 100644
--- a/backend/src/services/listeners/RestoreEventListener.ts
+++ b/backend/src/services/listeners/RestoreEventListener.ts
@@ -32,22 +32,18 @@ export class RestoreEventListener {
}
private async onRestoreStart(data: RestoreStartEvent) {
- console.log('onRestoreStart :', data);
await this.restoreEventService.onRestoreStart(data);
}
private async onRestoreError(eventPayload: RestoreErrorEvent) {
- console.log('onRestoreError :', eventPayload);
await this.restoreEventService.onRestoreError(eventPayload);
}
private async onRestoreFailed(eventPayload: RestoreErrorEvent) {
- console.log('onRestoreFailed :', eventPayload);
await this.restoreEventService.onRestoreFailed(eventPayload);
}
private async onRestoreComplete(eventPayload: RestoreCompleteEvent) {
- console.log('onRestoreComplete :', eventPayload);
await this.restoreEventService.onRestoreComplete(eventPayload);
}
}
diff --git a/backend/src/strategies/backup/LocalStrategy.ts b/backend/src/strategies/backup/LocalStrategy.ts
index 6d69733..4258478 100644
--- a/backend/src/strategies/backup/LocalStrategy.ts
+++ b/backend/src/strategies/backup/LocalStrategy.ts
@@ -12,7 +12,6 @@ export class LocalStrategy implements BackupStrategy {
}
async createBackup(backupId: string, options: BackupPlanArgs) {
- console.log('[Local] createBackup:', backupId);
return await this.localAgent.createBackup(backupId, options);
}
diff --git a/backend/src/utils/restic/restic.ts b/backend/src/utils/restic/restic.ts
index 3865d28..77dd978 100644
--- a/backend/src/utils/restic/restic.ts
+++ b/backend/src/utils/restic/restic.ts
@@ -183,7 +183,6 @@ export async function getBackupPlanStats(
snapshotBackupIds.push(backupIdTag.replace('backup-', ''));
}
});
- console.log('snapshotBackupIds :', snapshotBackupIds);
return {
total_size: theStats.total_size,