From 79372527e691c9009e045e8eade4011d93535c33 Mon Sep 17 00:00:00 2001 From: Mauricio Siu <47042324+Siumauricio@users.noreply.github.com> Date: Mon, 5 May 2025 02:37:49 -0600 Subject: [PATCH] Update backup command execution to use bash shell - Modified the `execAsync` call in `postgres.ts` to specify the bash shell for executing backup commands, ensuring compatibility with bash-specific features. - Removed the shebang line from the backup command script in `utils.ts` to streamline the script's execution context. --- packages/server/src/utils/backups/postgres.ts | 4 +++- packages/server/src/utils/backups/utils.ts | 1 - 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/server/src/utils/backups/postgres.ts b/packages/server/src/utils/backups/postgres.ts index 29974106a..c30d88616 100644 --- a/packages/server/src/utils/backups/postgres.ts +++ b/packages/server/src/utils/backups/postgres.ts @@ -39,7 +39,9 @@ export const runPostgresBackup = async ( if (postgres.serverId) { await execAsyncRemote(postgres.serverId, backupCommand); } else { - await execAsync(backupCommand); + await execAsync(backupCommand, { + shell: "/bin/bash", + }); } await sendDatabaseBackupNotifications({ diff --git a/packages/server/src/utils/backups/utils.ts b/packages/server/src/utils/backups/utils.ts index 67cf097d3..0d4471f62 100644 --- a/packages/server/src/utils/backups/utils.ts +++ b/packages/server/src/utils/backups/utils.ts @@ -220,7 +220,6 @@ export const getBackupCommand = ( const containerSearch = getContainerSearchCommand(backup); const backupCommand = generateBackupCommand(backup); return ` - #!/bin/bash set -eo pipefail; echo "[$(date)] Starting backup process..." >> ${logPath}; echo "[$(date)] Executing backup command..." >> ${logPath};