From f49f4a7ffd9d466c7a135740e8567a71e3f29851 Mon Sep 17 00:00:00 2001 From: Jiri Kucera Date: Tue, 7 Feb 2023 02:40:27 +0100 Subject: [PATCH] lsr-logs-clean: Add MAILTO to cron file Set MAILTO for the particular cron file to the email address of the Linux system roles community so any output from the log pruning job going to stderr is reported to them. Send stdout to /dev/null since it is not important. Signed-off-by: Jiri Kucera --- playbooks/groups/secondary.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/playbooks/groups/secondary.yml b/playbooks/groups/secondary.yml index fb459bdb5e..e48f95e971 100644 --- a/playbooks/groups/secondary.yml +++ b/playbooks/groups/secondary.yml @@ -78,7 +78,11 @@ - name: Prune old logs at /srv/pub/alt/linuxsystemroles/logs cron: name="linuxsystemroles-logs-clean" hour="0" minute="15" user="root" - job="/usr/local/bin/linuxsystemroles-logs-clean /srv/pub/alt/linuxsystemroles/logs" + job="/usr/local/bin/linuxsystemroles-logs-clean /srv/pub/alt/linuxsystemroles/logs >/dev/null" + cron_file=linuxsystemroles-logs-clean + + - name: Set MAILTO for the previous cron job + cron: env=true name=MAILTO value="systemroles-owner@lists.fedorahosted.org" cron_file=linuxsystemroles-logs-clean handlers: