From bf510fa933d0ddaac704251ef14036fefeb44584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isma=C3=ABl=20Bouya?= Date: Fri, 17 Jan 2020 01:15:21 +0100 Subject: Remove mail command in backup script --- modules/rsync_backup/default.nix | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/modules/rsync_backup/default.nix b/modules/rsync_backup/default.nix index dadf5e7c..a2ef0fdc 100644 --- a/modules/rsync_backup/default.nix +++ b/modules/rsync_backup/default.nix @@ -84,19 +84,16 @@ let ssh_key = config.secrets.fullPaths."rsync_backup/identity"; - backup_head = mailto: '' + backup_head = '' #!${pkgs.stdenv.shell} EXCL_FROM=`mktemp` FILES_FROM=`mktemp` TMP_STDERR=`mktemp` on_exit() { - ${lib.optionalString (mailto != null) '' - MAILTO="${mailto}" if [ -s "$TMP_STDERR" ]; then - cat "$TMP_STDERR" | ${pkgs.mailutils}/bin/mail -s "save_distant rsync error" "$MAILTO" + cat "$TMP_STDERR" fi - ''} rm -f $TMP_STDERR $EXCL_FROM $FILES_FROM } @@ -186,11 +183,6 @@ in type = lib.types.path; description = "Path to the base folder for backups"; }; - mailto = lib.mkOption { - type = lib.types.nullOr lib.types.str; - default = null; - description = "E-mail to send the report to"; - }; profiles = lib.mkOption { type = lib.types.attrsOf profileModule; default = {}; @@ -223,7 +215,7 @@ in services.cron.systemCronJobs = let backup = pkgs.writeScript "backup.sh" (builtins.concatStringsSep "\n" ([ - (backup_head cfg.mailto) + backup_head ] ++ lib.mapAttrsToList backup_profile cfg.profiles)); in [ '' -- cgit v1.2.3