mysql-backup.nix: add option to use single transaction for dumps
svn path=/nixos/trunk/; revision=24594
This commit is contained in:
parent
cf84a44272
commit
f34d7250b3
1 changed files with 10 additions and 3 deletions
|
@ -6,10 +6,10 @@ let
|
|||
|
||||
inherit (pkgs) mysql gzip;
|
||||
|
||||
location = config.services.mysqlBackup.location ;
|
||||
|
||||
cfg = config.services.mysqlBackup ;
|
||||
location = cfg.location ;
|
||||
mysqlBackupCron = db : ''
|
||||
${config.services.mysqlBackup.period} ${config.services.mysqlBackup.user} ${mysql}/bin/mysqldump ${db} | ${gzip}/bin/gzip -c > ${location}/${db}.gz
|
||||
${cfg.period} ${cfg.user} ${mysql}/bin/mysqldump ${if cfg.singleTransaction then "--single-transaction" else ""} ${db} | ${gzip}/bin/gzip -c > ${location}/${db}.gz
|
||||
'';
|
||||
|
||||
in
|
||||
|
@ -55,6 +55,13 @@ in
|
|||
Location to put the gzipped MySQL database dumps.
|
||||
'';
|
||||
};
|
||||
|
||||
singleTransaction = mkOption {
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to create database dump in a single transaction
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue