diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2024-10-12 16:23:52 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2025-03-14 00:51:36 +0100 |
commit | 0c80bdffd3beb43481d2938589b061d72572b17b (patch) | |
tree | 3106399626fd08d711ffa71a673d5d63b475c481 /systems/backup-2/databases/openldap_replication.nix | |
parent | 59a0fb35cd14aae6c778e9aad7f7e6d97a7d055c (diff) | |
download | Nix-0c80bdffd3beb43481d2938589b061d72572b17b.tar.gz Nix-0c80bdffd3beb43481d2938589b061d72572b17b.tar.zst Nix-0c80bdffd3beb43481d2938589b061d72572b17b.zip |
Add database backup
Diffstat (limited to 'systems/backup-2/databases/openldap_replication.nix')
-rw-r--r-- | systems/backup-2/databases/openldap_replication.nix | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/systems/backup-2/databases/openldap_replication.nix b/systems/backup-2/databases/openldap_replication.nix index b962224..d3cda1c 100644 --- a/systems/backup-2/databases/openldap_replication.nix +++ b/systems/backup-2/databases/openldap_replication.nix | |||
@@ -121,7 +121,11 @@ in | |||
121 | backup_script = pkgs.writeScript "backup_openldap_${name}" '' | 121 | backup_script = pkgs.writeScript "backup_openldap_${name}" '' |
122 | #!${pkgs.stdenv.shell} | 122 | #!${pkgs.stdenv.shell} |
123 | 123 | ||
124 | ${hcfg.package}/bin/slapcat -b "${hcfg.base}" -f ${ldapConfig hcfg name} -l ${backupDir}/$(${pkgs.coreutils}/bin/date -Iminutes).ldif | 124 | filename="${backupDir}/$(${pkgs.coreutils}/bin/date -Iminutes).ldif" |
125 | ${hcfg.package}/bin/slapcat -b "${hcfg.base}" -f ${ldapConfig hcfg name} -l "$filename" | ||
126 | |||
127 | mkdir -p "${cfg.base}/${name}/databases_latest_backups" | ||
128 | ln -f "$filename" "${cfg.base}/${name}/databases_latest_backups/openldap.ldif" | ||
125 | ''; | 129 | ''; |
126 | u = pkgs.callPackage ./utils.nix {}; | 130 | u = pkgs.callPackage ./utils.nix {}; |
127 | cleanup_script = pkgs.writeScript "cleanup_openldap_${name}" (u.exponentialDumps "ldif" backupDir); | 131 | cleanup_script = pkgs.writeScript "cleanup_openldap_${name}" (u.exponentialDumps "ldif" backupDir); |