summaryrefslogtreecommitdiffstats
path: root/nixos/modules/services/backup
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2023-11-26 13:22:51 +0100
committerRobert Helgesson <robert@rycee.net>2023-12-01 19:08:31 +0100
commit0aaf428fde038183adfb433dbbc8688b5ef0eb6c (patch)
tree57bda3e5ce0d1ea8de3d063702aee1b860f6de1e /nixos/modules/services/backup
parent786100e12d24e50888986a553a26a60bbd484f01 (diff)
nixos/postgresqlBackup: add --rsyncable to compression programs
The --rsyncable option changes the behavior of gzip/zstd so that the resulting files can be incrementally backed up easily. Tools like Borg, rsync and xdelta can make use their deduplication/diff mechanisms more easily. In my local testing, this resulted in a 2% size increase for backup files. Signed-off-by: Sefa Eyeoglu <contact@scrumplex.net>
Diffstat (limited to 'nixos/modules/services/backup')
-rw-r--r--nixos/modules/services/backup/postgresql-backup.nix4
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/services/backup/postgresql-backup.nix b/nixos/modules/services/backup/postgresql-backup.nix
index d3c6f3104fc5..8941386bdefb 100644
--- a/nixos/modules/services/backup/postgresql-backup.nix
+++ b/nixos/modules/services/backup/postgresql-backup.nix
@@ -17,8 +17,8 @@ let
compressCmd = getAttr cfg.compression {
"none" = "cat";
- "gzip" = "${pkgs.gzip}/bin/gzip -c -${toString cfg.compressionLevel}";
- "zstd" = "${pkgs.zstd}/bin/zstd -c -${toString cfg.compressionLevel}";
+ "gzip" = "${pkgs.gzip}/bin/gzip -c -${toString cfg.compressionLevel} --rsyncable";
+ "zstd" = "${pkgs.zstd}/bin/zstd -c -${toString cfg.compressionLevel} --rsyncable";
};
mkSqlPath = prefix: suffix: "${cfg.location}/${db}${prefix}.sql${suffix}";