password = ${hcfg.dumpPassword}
'';
}
+ {
+ dest = "mysql_replication/${name}/client";
+ permissions = "0400";
+ user = "mysql";
+ group = "mysql";
+ text = ''
+ [client]
+ user = ${hcfg.dumpUser}
+ password = ${hcfg.dumpPassword}
+ '';
+ }
]) cfg.hosts);
services.cron = {
--all-databases > ${backupDir}/$(${pkgs.coreutils}/bin/date -Iseconds).sql
'';
u = pkgs.callPackage ./utils.nix {};
- cleanup_script = pkgs.writeScript "cleanup_mysql_${name}" (u.exponentialDumps backupDir);
+ cleanup_script = pkgs.writeScript "cleanup_mysql_${name}" (u.exponentialDumps "sql" backupDir);
in [
"0 22,4,10,16 * * * root ${backup_script}"
"0 3 * * * root ${cleanup_script}"