mysql-backup.nix: add option to use single transaction for dumps

svn path=/nixos/trunk/; revision=24594
This commit is contained in:
Rob Vermaas 2010-11-04 08:13:57 +00:00
parent cf84a44272
commit f34d7250b3

View file

@ -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
'';
};
};
};