Don
This commit is contained in:
parent
9d04be773f
commit
9872c016d5
|
@ -8,7 +8,9 @@ with open ("/etc/bacula/scripts/webhooks/ChrisProEliteMail.md", "r") as myfile:
|
||||||
cleaned_stdout=myfile.read()
|
cleaned_stdout=myfile.read()
|
||||||
|
|
||||||
if "Termination: Backup OK" in cleaned_stdout:
|
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:
|
else:
|
||||||
# Discord limits each message to 2000 chars, if the message is longer than that, truncate it
|
# 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)]
|
truncated_stdout = [cleaned_stdout[i:i+maxCharPerMessage] for i in range(0, len(cleaned_stdout), maxCharPerMessage)]
|
||||||
|
|
|
@ -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: No Jobs found to prune.
|
||||||
11-Aug 12:43 bacula-dir JobId 310: Begin pruning Files.
|
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: No Files found to prune.
|
||||||
11-Aug 12:43 bacula-dir JobId 310: End auto prune.
|
11-Aug 12:43 bacula-dir JobId 310: End auto prune.
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,9 @@ with open ("/etc/bacula/scripts/webhooks/RoboticsMail.md", "r") as myfile:
|
||||||
cleaned_stdout=myfile.read()
|
cleaned_stdout=myfile.read()
|
||||||
|
|
||||||
if "Termination: Backup OK" in cleaned_stdout:
|
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:
|
else:
|
||||||
# Discord limits each message to 2000 chars, if the message is longer than that, truncate it
|
# 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)]
|
truncated_stdout = [cleaned_stdout[i:i+maxCharPerMessage] for i in range(0, len(cleaned_stdout), maxCharPerMessage)]
|
||||||
|
|
|
@ -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: No Jobs found to prune.
|
||||||
11-Aug 02:56 bacula-dir JobId 308: Begin pruning Files.
|
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: No Files found to prune.
|
||||||
11-Aug 02:56 bacula-dir JobId 308: End auto prune.
|
11-Aug 02:56 bacula-dir JobId 308: End auto prune.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue