mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-16 06:58:12 +00:00
mysqlBackup: use rsyncable compression
This commit is contained in:
parent
8eb972be1e
commit
9be35dff51
@ -20,7 +20,7 @@ let
|
||||
'';
|
||||
backupDatabaseScript = db: ''
|
||||
dest="${cfg.location}/${db}.gz"
|
||||
if ${mariadb}/bin/mysqldump ${optionalString cfg.singleTransaction "--single-transaction"} ${db} | ${gzip}/bin/gzip -c > $dest.tmp; then
|
||||
if ${mariadb}/bin/mysqldump ${optionalString cfg.singleTransaction "--single-transaction"} ${db} | ${gzip}/bin/gzip -c ${cfg.gzipOptions} > $dest.tmp; then
|
||||
mv $dest.tmp $dest
|
||||
echo "Backed up to $dest"
|
||||
else
|
||||
@ -78,6 +78,14 @@ in
|
||||
Whether to create database dump in a single transaction
|
||||
'';
|
||||
};
|
||||
|
||||
gzipOptions = mkOption {
|
||||
default = "--no-name --rsyncable";
|
||||
type = types.str;
|
||||
description = ''
|
||||
Command line options to use when invoking `gzip`.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user