Browse Source

Merge pull request #516 from carljm/opendmarc-silent-cron

Make OpenDMARC cron job log everything instead of mailing some output to root.
Sven Neuhaus 8 years ago
parent
commit
d1df544634

+ 1
- 2
roles/mailserver/tasks/opendmarc.yml View File

@@ -38,5 +38,4 @@
38 38
   file: path=/var/run/opendmarc/opendmarc.dat state=touch owner=opendmarc group=opendmarc
39 39
 
40 40
 - name: Activate OpenDMARC report cronjob
41
-  cron: name="OpenDMARC report" hour="2" minute="0" job="/bin/bash /etc/opendmarc/report.sh >> /var/log/opendmarc_report.log"
42
-
41
+  cron: name="OpenDMARC report" hour="2" minute="0" job="/bin/bash /etc/opendmarc/report.sh >> /var/log/opendmarc_report.log 2>&1 || tail /var/log/opendmarc_report.log"

+ 3
- 0
roles/mailserver/templates/etc_opendmarc_report.sh.j2 View File

@@ -1,5 +1,8 @@
1 1
 #!/bin/bash
2 2
 
3
+# ensure this script errors out if any of its steps do
4
+set -e
5
+
3 6
 DB_SERVER='localhost'
4 7
 DB_USER='{{ mail_db_opendmarc_username }}'
5 8
 DB_PASS='{{ mail_db_opendmarc_password }}'

Loading…
Cancel
Save