Skip to content

Commit

Permalink
fix(server): database backups compatible with deduplication (immich-a…
Browse files Browse the repository at this point in the history
…pp#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 <[email protected]>
  • Loading branch information
Scrumplex authored and bdavis2-PCTY committed Nov 18, 2024
1 parent 505f733 commit 707f16b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion server/src/services/backup.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 707f16b

Please sign in to comment.