mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 12:45:27 +03:00
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>
This commit is contained in:
parent
786100e12d
commit
0aaf428fde
1 changed files with 2 additions and 2 deletions
|
@ -17,8 +17,8 @@ let
|
||||||
|
|
||||||
compressCmd = getAttr cfg.compression {
|
compressCmd = getAttr cfg.compression {
|
||||||
"none" = "cat";
|
"none" = "cat";
|
||||||
"gzip" = "${pkgs.gzip}/bin/gzip -c -${toString cfg.compressionLevel}";
|
"gzip" = "${pkgs.gzip}/bin/gzip -c -${toString cfg.compressionLevel} --rsyncable";
|
||||||
"zstd" = "${pkgs.zstd}/bin/zstd -c -${toString cfg.compressionLevel}";
|
"zstd" = "${pkgs.zstd}/bin/zstd -c -${toString cfg.compressionLevel} --rsyncable";
|
||||||
};
|
};
|
||||||
|
|
||||||
mkSqlPath = prefix: suffix: "${cfg.location}/${db}${prefix}.sql${suffix}";
|
mkSqlPath = prefix: suffix: "${cfg.location}/${db}${prefix}.sql${suffix}";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue