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:
committed by
Robert Helgesson
parent
786100e12d
commit
0aaf428fde
@@ -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}";
|
||||||
|
|||||||
Reference in New Issue
Block a user