From 9872c016d57b1983cae2563fec947654af92f6c1 Mon Sep 17 00:00:00 2001 From: Joe S <31870999+KenwoodFox@users.noreply.github.com> Date: Tue, 11 Aug 2020 15:51:20 -0400 Subject: [PATCH] Don --- Dir Config/scripts/webhooks/ChrisProElite-Bacula-Webhook.py | 4 +++- Dir Config/scripts/webhooks/ChrisProEliteMail.md | 3 ++- Dir Config/scripts/webhooks/Robotics-Bacula-Webhook.py | 4 +++- Dir Config/scripts/webhooks/RoboticsMail.md | 3 ++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Dir Config/scripts/webhooks/ChrisProElite-Bacula-Webhook.py b/Dir Config/scripts/webhooks/ChrisProElite-Bacula-Webhook.py index e3a94a3..3277f28 100644 --- a/Dir Config/scripts/webhooks/ChrisProElite-Bacula-Webhook.py +++ b/Dir Config/scripts/webhooks/ChrisProElite-Bacula-Webhook.py @@ -8,7 +8,9 @@ with open ("/etc/bacula/scripts/webhooks/ChrisProEliteMail.md", "r") as myfile: cleaned_stdout=myfile.read() if "Termination: Backup OK" in cleaned_stdout: - truncated_stdout = ["Job Backup-Chris completed with status Backup OK, omitting full report.\nAll data from nextcloud was successfully written to tape on " + mextract(cleaned_stdout, "End time:") + ".\nBackup took " + mextract(cleaned_stdout, "Elapsed time:") + " And used " + mextract(cleaned_stdout, "SD Bytes Written:") + " bytes."] + truncated_stdout = ["""Job Backup-Chris completed with status Backup OK, omitting full report. +All data from nextcloud was successfully written to tape on """ + mextract(cleaned_stdout, "End time:") + """. +Backup took """ + mextract(cleaned_stdout, "Elapsed time:") + " And used " + mextract(cleaned_stdout, "SD Bytes Written:") + " bytes."] else: # Discord limits each message to 2000 chars, if the message is longer than that, truncate it truncated_stdout = [cleaned_stdout[i:i+maxCharPerMessage] for i in range(0, len(cleaned_stdout), maxCharPerMessage)] diff --git a/Dir Config/scripts/webhooks/ChrisProEliteMail.md b/Dir Config/scripts/webhooks/ChrisProEliteMail.md index cf1bc2b..982d684 100644 --- a/Dir Config/scripts/webhooks/ChrisProEliteMail.md +++ b/Dir Config/scripts/webhooks/ChrisProEliteMail.md @@ -48,4 +48,5 @@ 11-Aug 12:43 bacula-dir JobId 310: No Jobs found to prune. 11-Aug 12:43 bacula-dir JobId 310: Begin pruning Files. 11-Aug 12:43 bacula-dir JobId 310: No Files found to prune. -11-Aug 12:43 bacula-dir JobId 310: End auto prune. \ No newline at end of file +11-Aug 12:43 bacula-dir JobId 310: End auto prune. + diff --git a/Dir Config/scripts/webhooks/Robotics-Bacula-Webhook.py b/Dir Config/scripts/webhooks/Robotics-Bacula-Webhook.py index 2309bbe..a8882a2 100644 --- a/Dir Config/scripts/webhooks/Robotics-Bacula-Webhook.py +++ b/Dir Config/scripts/webhooks/Robotics-Bacula-Webhook.py @@ -8,7 +8,9 @@ with open ("/etc/bacula/scripts/webhooks/RoboticsMail.md", "r") as myfile: cleaned_stdout=myfile.read() if "Termination: Backup OK" in cleaned_stdout: - truncated_stdout = ["Job Backup-Robotics completed with status Backup OK, omitting full report.\nAll data from 1721's google drive was successfully written to tape on " + mextract(cleaned_stdout, "End time:") + ".\nBackup took " + mextract(cleaned_stdout, "Elapsed time:") + " And used " + mextract(cleaned_stdout, "SD Bytes Written:") + " bytes."] + truncated_stdout = ["""Job Backup-Robotics completed with status Backup OK, omitting full report. +All data from 1721's google drive was successfully written to tape on """ + mextract(cleaned_stdout, "End time:") + """. +Backup took """ + mextract(cleaned_stdout, "Elapsed time:") + " And used " + mextract(cleaned_stdout, "SD Bytes Written:") + " bytes."] else: # Discord limits each message to 2000 chars, if the message is longer than that, truncate it truncated_stdout = [cleaned_stdout[i:i+maxCharPerMessage] for i in range(0, len(cleaned_stdout), maxCharPerMessage)] diff --git a/Dir Config/scripts/webhooks/RoboticsMail.md b/Dir Config/scripts/webhooks/RoboticsMail.md index 81d4706..7948c92 100644 --- a/Dir Config/scripts/webhooks/RoboticsMail.md +++ b/Dir Config/scripts/webhooks/RoboticsMail.md @@ -44,4 +44,5 @@ 11-Aug 02:56 bacula-dir JobId 308: No Jobs found to prune. 11-Aug 02:56 bacula-dir JobId 308: Begin pruning Files. 11-Aug 02:56 bacula-dir JobId 308: No Files found to prune. -11-Aug 02:56 bacula-dir JobId 308: End auto prune. \ No newline at end of file +11-Aug 02:56 bacula-dir JobId 308: End auto prune. +