mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-20 04:33:57 +00:00
added system cron mailto option
svn path=/nixos/trunk/; revision=13114
This commit is contained in:
parent
1d55390e1c
commit
32b263e429
@ -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 <option>security.setuidOwners</option>
|
||||
'';
|
||||
};
|
||||
|
||||
|
@ -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)}
|
||||
'';
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user