From 707f16b39db732e603a6e1fb7f0854176e3b083f Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Thu, 7 Nov 2024 13:36:17 +0100 Subject: [PATCH] fix(server): database backups compatible with deduplication (#13965) gzip --rsyncable has a slightly worse compression ratio, but allows for efficient deduplication and, as the name implies, faster rsync operations. Signed-off-by: Sefa Eyeoglu --- server/src/services/backup.service.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/src/services/backup.service.ts b/server/src/services/backup.service.ts index 3dad4f1016ce5..1febe791305b4 100644 --- a/server/src/services/backup.service.ts +++ b/server/src/services/backup.service.ts @@ -97,7 +97,8 @@ export class BackupService extends BaseService { env: { PATH: process.env.PATH, PGPASSWORD: isUrlConnection ? undefined : config.password }, }); - const gzip = this.processRepository.spawn(`gzip`, []); + // NOTE: `--rsyncable` is only supported in GNU gzip + const gzip = this.processRepository.spawn(`gzip`, ['--rsyncable']); pgdump.stdout.pipe(gzip.stdin); const fileStream = this.storageRepository.createWriteStream(backupFilePath);