From 32b263e4296a64410d874866de73092bfd20f26e Mon Sep 17 00:00:00 2001 From: Marc Weber Date: Sat, 25 Oct 2008 22:03:12 +0000 Subject: [PATCH] added system cron mailto option svn path=/nixos/trunk/; revision=13114 --- system/options.nix | 8 +++++++- upstart-jobs/cron.nix | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/system/options.nix b/system/options.nix index d15c2164545..3e8828fdb73 100644 --- a/system/options.nix +++ b/system/options.nix @@ -654,6 +654,11 @@ in cron = { + mailto = mkOption { + default = ""; + description = " The job output will be mailed to this email address. "; + }; + systemCronJobs = mkOption { default = []; example = [ @@ -663,7 +668,8 @@ in description = '' A list of Cron jobs to be appended to the system-wide crontab. See the manual page for crontab for the expected - format. + format. If you want to get the results mailed you must setuid + sendmail. See ''; }; diff --git a/upstart-jobs/cron.nix b/upstart-jobs/cron.nix index e2212b4c575..209eb562fa9 100644 --- a/upstart-jobs/cron.nix +++ b/upstart-jobs/cron.nix @@ -20,7 +20,7 @@ let systemCronJobsFile = pkgs.writeText "system-crontab" '' SHELL=${pkgs.bash}/bin/sh PATH=${pkgs.coreutils}/bin:${pkgs.findutils}/bin:${pkgs.gnused}/bin:${pkgs.su}/bin - MAILTO= + MAILTO="${config.services.cron.mailto}" ${pkgs.lib.concatStrings (map (job: job + "\n") systemCronJobs)} '';