Преглед изворни кода

Make OpenDMARC cron job email root only on error.

Carl Meyer пре 8 година
родитељ
комит
d46fb1521b

+ 1
- 2
roles/mailserver/tasks/opendmarc.yml Прегледај датотеку

@@ -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 Прегледај датотеку

@@ -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…
Откажи
Сачувај