Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/server/src/utils/backups/compose.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ export const runComposeBackup = async (

await updateDeploymentStatus(deployment.deploymentId, "done");
} catch (error) {
console.log(error);
console.error(
"Compose backup failed:",
error instanceof Error ? error.message : "Unknown error",
);
await sendDatabaseBackupNotifications({
applicationName: name,
projectName: project.name,
Expand Down
6 changes: 5 additions & 1 deletion packages/server/src/utils/backups/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { sendDockerCleanupNotifications } from "../notifications/docker-cleanup"
import { execAsync, execAsyncRemote } from "../process/execAsync";
import { getS3Credentials, normalizeS3Path, scheduleBackup } from "./utils";


export const initCronJobs = async () => {
console.log("Setting up cron jobs....");

Expand Down Expand Up @@ -153,6 +154,9 @@ export const keepLatestNBackups = async (
await execAsync(rcloneCommand);
}
} catch (error) {
console.error(error);
console.error(
"Failed to cleanup old backups:",
error instanceof Error ? error.message : "Unknown error",
);
}
};
5 changes: 4 additions & 1 deletion packages/server/src/utils/backups/mariadb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ export const runMariadbBackup = async (
});
await updateDeploymentStatus(deployment.deploymentId, "done");
} catch (error) {
console.log(error);
console.error(
"MariaDB backup failed:",
error instanceof Error ? error.message : "Unknown error",
);
await sendDatabaseBackupNotifications({
applicationName: name,
projectName: project.name,
Expand Down
5 changes: 4 additions & 1 deletion packages/server/src/utils/backups/mongo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ export const runMongoBackup = async (mongo: Mongo, backup: BackupSchedule) => {
});
await updateDeploymentStatus(deployment.deploymentId, "done");
} catch (error) {
console.log(error);
console.error(
"MongoDB backup failed:",
error instanceof Error ? error.message : "Unknown error",
);
await sendDatabaseBackupNotifications({
applicationName: name,
projectName: project.name,
Expand Down
5 changes: 4 additions & 1 deletion packages/server/src/utils/backups/mysql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,10 @@ export const runMySqlBackup = async (mysql: MySql, backup: BackupSchedule) => {
});
await updateDeploymentStatus(deployment.deploymentId, "done");
} catch (error) {
console.log(error);
console.error(
"MySQL backup failed:",
error instanceof Error ? error.message : "Unknown error",
);
await sendDatabaseBackupNotifications({
applicationName: name,
projectName: project.name,
Expand Down
6 changes: 2 additions & 4 deletions packages/server/src/utils/backups/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,8 @@ export const getBackupCommand = (

logger.info(
{
containerSearch,
backupCommand,
rcloneCommand,
logPath,

logPath
},
`Executing backup command: ${backup.databaseType} ${backup.backupType}`,
);
Expand Down
12 changes: 10 additions & 2 deletions packages/server/src/utils/backups/web-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,19 @@ export const runWebServerBackup = async (backup: BackupSchedule) => {
try {
await rm(tempDir, { recursive: true, force: true });
} catch (cleanupError) {
console.error("Cleanup error:", cleanupError);
console.error(
"Cleanup error:",
cleanupError instanceof Error
? cleanupError.message
: "Unknown error",
);
}
}
} catch (error) {
console.error("Backup error:", error);
console.error(
"Backup error:",
error instanceof Error ? error.message : "Unknown error",
);
writeStream.write("Backup error❌\n");
writeStream.write(
error instanceof Error ? error.message : "Unknown error\n",
Expand Down