copy to persisten storage

This commit is contained in:
Andras Bacsai
2023-07-25 12:38:36 +02:00
parent 343957ab8b
commit 2abd7bd7bb

View File

@@ -1972,11 +1972,15 @@ export async function backupDatabaseNow(database, reply) {
dockerId: database.destinationDockerId, dockerId: database.destinationDockerId,
command, command,
}); });
const copyCommand = `docker cp ${database.id}:${backupFileName} ${backupStorageFilename}` const copyCommand = `docker cp ${database.id}:${backupFileName} ${backupFileName}`
await executeCommand({ await executeCommand({
dockerId: database.destinationDockerId, dockerId: database.destinationDockerId,
command: copyCommand command: copyCommand
}); });
await executeCommand({
dockerId: database.destinationDockerId,
command: `docker cp ${database.id}:${backupFileName} /app/backups/`
});
const stream = fsNormal.createReadStream(backupFileName); const stream = fsNormal.createReadStream(backupFileName);
reply.header('Content-Type', 'application/octet-stream'); reply.header('Content-Type', 'application/octet-stream');
reply.header('Content-Disposition', `attachment; filename=${fileName}`); reply.header('Content-Disposition', `attachment; filename=${fileName}`);