mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Enhance backup command generation and logging for database backups
- Refactored backup utilities for PostgreSQL, MySQL, MariaDB, and MongoDB to streamline command generation and improve logging. - Introduced a unified `getBackupCommand` function to encapsulate backup command logic, enhancing maintainability. - Improved error handling and logging during backup processes, providing clearer feedback on command execution and success/failure states. - Updated container retrieval methods to return null instead of throwing errors when no containers are found, improving robustness.
This commit is contained in:
@@ -316,7 +316,7 @@ export const createDeploymentBackup = async (
|
||||
|
||||
const command = `
|
||||
mkdir -p ${LOGS_PATH}/${backup.appName};
|
||||
echo "Initializing backup" >> ${logFilePath};
|
||||
echo "Initializing backup\n" >> ${logFilePath};
|
||||
`;
|
||||
|
||||
await execAsyncRemote(server.serverId, command);
|
||||
@@ -324,7 +324,7 @@ echo "Initializing backup" >> ${logFilePath};
|
||||
await fsPromises.mkdir(path.join(LOGS_PATH, backup.appName), {
|
||||
recursive: true,
|
||||
});
|
||||
await fsPromises.writeFile(logFilePath, "Initializing backup");
|
||||
await fsPromises.writeFile(logFilePath, "Initializing backup\n");
|
||||
}
|
||||
|
||||
const deploymentCreate = await db
|
||||
|
||||
Reference in New Issue
Block a user