From 9be35dff51c4cba8846ef5c162de1433a21cc1ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Sch=C3=BCtz?= Date: Sat, 30 Mar 2024 10:16:19 +0100 Subject: [PATCH] mysqlBackup: use rsyncable compression --- nixos/modules/services/backup/mysql-backup.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/backup/mysql-backup.nix b/nixos/modules/services/backup/mysql-backup.nix index 00381be4b75d..e3fa7f45844f 100644 --- a/nixos/modules/services/backup/mysql-backup.nix +++ b/nixos/modules/services/backup/mysql-backup.nix @@ -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`. + ''; + }; }; };