fix(dokploy): add missing --archive to mongodump

This commit is contained in:
Mauricio Siu
2024-10-24 01:07:02 -06:00
parent 22eb965919
commit 522f8baec7

View File

@@ -29,7 +29,7 @@ export const runMongoBackup = async (mongo: Mongo, backup: BackupSchedule) => {
mongo.serverId, mongo.serverId,
appName, appName,
); );
const mongoDumpCommand = `docker exec ${containerId} sh -c "mongodump -d '${database}' -u '${databaseUser}' -p '${databasePassword}' --authenticationDatabase=admin --gzip"`; const mongoDumpCommand = `docker exec ${containerId} sh -c "mongodump -d '${database}' -u '${databaseUser}' -p '${databasePassword}' --archive --authenticationDatabase=admin --gzip"`;
await execAsyncRemote( await execAsyncRemote(
mongo.serverId, mongo.serverId,
@@ -37,7 +37,7 @@ export const runMongoBackup = async (mongo: Mongo, backup: BackupSchedule) => {
); );
} else { } else {
const { Id: containerId } = await getServiceContainer(appName); const { Id: containerId } = await getServiceContainer(appName);
const mongoDumpCommand = `docker exec ${containerId} sh -c "mongodump -d '${database}' -u '${databaseUser}' -p '${databasePassword}' --authenticationDatabase=admin --gzip"`; const mongoDumpCommand = `docker exec ${containerId} sh -c "mongodump -d '${database}' -u '${databaseUser}' -p '${databasePassword}' --archive --authenticationDatabase=admin --gzip"`;
await execAsync(`${mongoDumpCommand} | ${rcloneCommand}`); await execAsync(`${mongoDumpCommand} | ${rcloneCommand}`);
} }