diff --git a/Dir Config/bacula-dir.conf b/Dir Config/bacula-dir.conf index 6f3bab6..ff3bd15 100644 --- a/Dir Config/bacula-dir.conf +++ b/Dir Config/bacula-dir.conf @@ -177,3 +177,11 @@ messages { # Send mail to me and Aidan console = all, !skipped, !saved catalog = all } + +messages { # Send mail to me and FireBN + name = FireBNMail + mail = kenwood364@gmail.com = all, !skipped + file = "/etc/bacula/scripts/webhooks/FireBN-Bacula-Mail.md" = all, !skipped + console = all, !skipped, !saved + catalog = all +} diff --git a/Dir Config/clients/zinc-client-users.conf b/Dir Config/clients/zinc-client-users.conf index 1e77eb4..a3ec006 100644 --- a/Dir Config/clients/zinc-client-users.conf +++ b/Dir Config/clients/zinc-client-users.conf @@ -65,4 +65,11 @@ Job { # Backup Aidan JobDefs = "Default-User-Job" FileSet = "Aidan Backup" Messages = AidanMail -} \ No newline at end of file +} + +Job { # Backup FireBN + Name = "Backup-FireBN" + JobDefs = "Default-User-Job" + FileSet = "FireBN Backup" + Messages = FireBNMail +} diff --git a/Dir Config/filesets/filesets-users.conf b/Dir Config/filesets/filesets-users.conf index d5e026f..4b55722 100644 --- a/Dir Config/filesets/filesets-users.conf +++ b/Dir Config/filesets/filesets-users.conf @@ -149,3 +149,15 @@ FileSet { File = "/mnt/NextCloud/data/aidan/" } } + +# FireBN's backup on zinc +FileSet { + Name = "FireBN Backup" + Include { + Options { + signature = MD5 + compression=GZIP + } + File = "/mnt/NextCloud/data/firebn/" + } +} diff --git a/Dir Config/pools.conf b/Dir Config/pools.conf index d5888a3..a4af0d9 100644 --- a/Dir Config/pools.conf +++ b/Dir Config/pools.conf @@ -47,6 +47,7 @@ Pool { Name = Archive-Pool Pool Type = Backup Recycle = no + Recycle Pool = Scratch AutoPrune = no Volume Retention = 30 years Storage = Iron-Autochanger diff --git a/Dir Config/scripts/webhooks/._sync_3f5c94a4c959.db b/Dir Config/scripts/webhooks/._sync_3f5c94a4c959.db index 8c1e799..91fd0a4 100644 Binary files a/Dir Config/scripts/webhooks/._sync_3f5c94a4c959.db and b/Dir Config/scripts/webhooks/._sync_3f5c94a4c959.db differ diff --git a/Dir Config/scripts/webhooks/Aidan-Bacula-Mail.md b/Dir Config/scripts/webhooks/Aidan-Bacula-Mail.md index 642552a..9f591e6 100644 --- a/Dir Config/scripts/webhooks/Aidan-Bacula-Mail.md +++ b/Dir Config/scripts/webhooks/Aidan-Bacula-Mail.md @@ -1,54 +1,48 @@ -23-Sep 23:59 bacula-dir JobId 437: No prior Full backup Job record found. -23-Sep 23:59 bacula-dir JobId 437: No prior or suitable Full backup found in catalog. Doing FULL backup. -23-Sep 23:59 bacula-dir JobId 437: Start Backup JobId 437, Job=Backup-Aidan.2020-09-23_23.59.41_16 -23-Sep 23:59 bacula-dir JobId 437: Using Device "Drive-1-LTO-3" to write. -24-Sep 00:00 bacula-iron-sd JobId 437: 3304 Issuing autochanger "load Volume A00718, Slot 2, Drive 1" command. -24-Sep 00:00 bacula-iron-sd JobId 437: 3305 Autochanger "load Volume A00718, Slot 2, Drive 1", status is OK. -24-Sep 00:00 bacula-iron-sd JobId 437: Volume "A00718" previously written, moving to end of data. -24-Sep 00:06 bacula-iron-sd JobId 437: Ready to append to end of Volume "A00718" at file=85. -24-Sep 00:06 bacula-iron-sd JobId 437: Spooling data ... -24-Sep 00:06 bacula-iron-sd JobId 437: Committing spooled data to Volume "A00718". Despooling 16,131,668 bytes ... -24-Sep 00:06 bacula-iron-sd JobId 437: Despooling elapsed time = 00:00:01, Transfer rate = 16.13 M Bytes/second -24-Sep 00:06 bacula-iron-sd JobId 437: Elapsed time=00:00:02, Transfer rate=8.057 M Bytes/second -24-Sep 00:06 bacula-iron-sd JobId 437: Sending spooled attrs to the Director. Despooling 4,978 bytes ... -24-Sep 00:06 bacula-dir JobId 437: Bacula bacula-dir 9.4.2 (04Feb19): +29-Sep 02:29 bacula-dir JobId 448: Start Backup JobId 448, Job=Backup-Aidan.2020-09-29_02.15.00_48 +29-Sep 02:29 bacula-dir JobId 448: Using Device "Drive-0-LTO-3" to write. +29-Sep 02:29 bacula-iron-sd JobId 448: Spooling data ... +29-Sep 02:29 bacula-iron-sd JobId 448: Committing spooled data to Volume "A02106". Despooling 430 bytes ... +29-Sep 02:29 bacula-iron-sd JobId 448: Despooling elapsed time = 00:00:01, Transfer rate = 430 Bytes/second +29-Sep 02:29 bacula-iron-sd JobId 448: Elapsed time=00:00:01, Transfer rate=0 Bytes/second +29-Sep 02:29 bacula-iron-sd JobId 448: Sending spooled attrs to the Director. Despooling 0 bytes ... +29-Sep 02:29 bacula-dir JobId 448: Bacula bacula-dir 9.4.2 (04Feb19): Build OS: x86_64-pc-linux-gnu ubuntu 20.04 - JobId: 437 - Job: Backup-Aidan.2020-09-23_23.59.41_16 - Backup Level: Full (upgraded from Incremental) + JobId: 448 + Job: Backup-Aidan.2020-09-29_02.15.00_48 + Backup Level: Incremental, since=2020-09-23 23:59:43 Client: "Zinc-Client" 9.6.3 (09Mar20) amd64-portbld-freebsd11.3,freebsd,11.3-RELEASE-p8 FileSet: "Aidan Backup" 2020-09-23 23:43:52 - Pool: "Full-Pool" (From Job FullPool override) + Pool: "Incr-Pool" (From Job IncPool override) Catalog: "MyCatalog" (From Client resource) Storage: "Iron-Autochanger" (From Pool resource) - Scheduled time: 23-Sep-2020 23:59:40 - Start time: 23-Sep-2020 23:59:43 - End time: 24-Sep-2020 00:06:32 - Elapsed time: 6 mins 49 secs + Scheduled time: 29-Sep-2020 02:15:00 + Start time: 29-Sep-2020 02:29:42 + End time: 29-Sep-2020 02:29:44 + Elapsed time: 2 secs Priority: 10 - FD Files Written: 21 - SD Files Written: 21 - FD Bytes Written: 16,112,636 (16.11 MB) - SD Bytes Written: 16,115,542 (16.11 MB) - Rate: 39.4 KB/s - Software Compression: 5.8% 1.1:1 + FD Files Written: 0 + SD Files Written: 0 + FD Bytes Written: 0 (0 B) + SD Bytes Written: 0 (0 B) + Rate: 0.0 KB/s + Software Compression: None Comm Line Compression: None Snapshot/VSS: no Encryption: no Accurate: no - Volume name(s): A00718 - Volume Session Id: 25 - Volume Session Time: 1599755230 - Last Volume Bytes: 338,586,587,136 (338.5 GB) + Volume name(s): + Volume Session Id: 10 + Volume Session Time: 1601284581 + Last Volume Bytes: 227,983,537,152 (227.9 GB) Non-fatal FD errors: 0 SD Errors: 0 FD termination status: OK SD termination status: OK Termination: Backup OK -24-Sep 00:06 bacula-dir JobId 437: Begin pruning Jobs older than 30 years . -24-Sep 00:06 bacula-dir JobId 437: No Jobs found to prune. -24-Sep 00:06 bacula-dir JobId 437: Begin pruning Files. -24-Sep 00:06 bacula-dir JobId 437: No Files found to prune. -24-Sep 00:06 bacula-dir JobId 437: End auto prune. +29-Sep 02:29 bacula-dir JobId 448: Begin pruning Jobs older than 30 years . +29-Sep 02:29 bacula-dir JobId 448: No Jobs found to prune. +29-Sep 02:29 bacula-dir JobId 448: Begin pruning Files. +29-Sep 02:29 bacula-dir JobId 448: No Files found to prune. +29-Sep 02:29 bacula-dir JobId 448: End auto prune. diff --git a/Dir Config/scripts/webhooks/ChrisProElite-Bacula-Webhook.py b/Dir Config/scripts/webhooks/ChrisProElite-Bacula-Webhook.py index 0ea567b..d9a1d84 100644 --- a/Dir Config/scripts/webhooks/ChrisProElite-Bacula-Webhook.py +++ b/Dir Config/scripts/webhooks/ChrisProElite-Bacula-Webhook.py @@ -7,7 +7,7 @@ maxCharPerMessage = 1994 bathook = bathook("/etc/bacula/scripts/webhooks/ChrisProEliteMail.md", "nextcloud") for message_part in bathook.get_formatted_message(): # For every message part in the truncated output, run this loop -webhook = DiscordWebhook(url=webhookURL, username="Snowsune's Bacula Daemon") # Attach the message + webhook = DiscordWebhook(url=webhookURL, username="Snowsune's Bacula Daemon") # Attach the message webhook.add_embed(bathook.get_discord_embed()) response = webhook.execute() # Hit send #message_part = "```" + message_part + "```" # Encapsulate the messsage diff --git a/Dir Config/scripts/webhooks/ChrisProEliteMail.md b/Dir Config/scripts/webhooks/ChrisProEliteMail.md index ca2d5dd..eaa0029 100644 --- a/Dir Config/scripts/webhooks/ChrisProEliteMail.md +++ b/Dir Config/scripts/webhooks/ChrisProEliteMail.md @@ -1,48 +1,48 @@ -22-Sep 02:24 bacula-dir JobId 430: Start Backup JobId 430, Job=Backup-Chris.2020-09-22_02.15.00_18 -22-Sep 02:24 bacula-dir JobId 430: Using Device "Drive-0-LTO-3" to write. -22-Sep 02:24 bacula-iron-sd JobId 430: Spooling data ... -22-Sep 02:24 bacula-iron-sd JobId 430: Committing spooled data to Volume "A02106". Despooling 912 bytes ... -22-Sep 02:24 bacula-iron-sd JobId 430: Despooling elapsed time = 00:00:01, Transfer rate = 912 Bytes/second -22-Sep 02:24 bacula-iron-sd JobId 430: Elapsed time=00:00:03, Transfer rate=144 Bytes/second -22-Sep 02:24 bacula-iron-sd JobId 430: Sending spooled attrs to the Director. Despooling 658 bytes ... -22-Sep 02:24 bacula-dir JobId 430: Bacula bacula-dir 9.4.2 (04Feb19): +29-Sep 02:23 bacula-dir JobId 444: Start Backup JobId 444, Job=Backup-Chris.2020-09-29_02.15.00_44 +29-Sep 02:23 bacula-dir JobId 444: Using Device "Drive-1-LTO-3" to write. +29-Sep 02:23 bacula-iron-sd JobId 444: Spooling data ... +29-Sep 02:23 bacula-iron-sd JobId 444: Committing spooled data to Volume "PF6866". Despooling 430 bytes ... +29-Sep 02:23 bacula-iron-sd JobId 444: Despooling elapsed time = 00:00:01, Transfer rate = 430 Bytes/second +29-Sep 02:23 bacula-iron-sd JobId 444: Elapsed time=00:00:04, Transfer rate=0 Bytes/second +29-Sep 02:23 bacula-iron-sd JobId 444: Sending spooled attrs to the Director. Despooling 0 bytes ... +29-Sep 02:23 bacula-dir JobId 444: Bacula bacula-dir 9.4.2 (04Feb19): Build OS: x86_64-pc-linux-gnu ubuntu 20.04 - JobId: 430 - Job: Backup-Chris.2020-09-22_02.15.00_18 - Backup Level: Incremental, since=2020-09-15 02:19:54 + JobId: 444 + Job: Backup-Chris.2020-09-29_02.15.00_44 + Backup Level: Incremental, since=2020-09-22 02:24:36 Client: "Zinc-Client" 9.6.3 (09Mar20) amd64-portbld-freebsd11.3,freebsd,11.3-RELEASE-p8 FileSet: "Chris Backup" 2020-06-23 16:46:12 Pool: "Incr-Pool" (From Job IncPool override) Catalog: "MyCatalog" (From Client resource) Storage: "Iron-Autochanger" (From Pool resource) - Scheduled time: 22-Sep-2020 02:15:00 - Start time: 22-Sep-2020 02:24:36 - End time: 22-Sep-2020 02:24:40 - Elapsed time: 4 secs + Scheduled time: 29-Sep-2020 02:15:00 + Start time: 29-Sep-2020 02:23:48 + End time: 29-Sep-2020 02:23:55 + Elapsed time: 7 secs Priority: 10 - FD Files Written: 4 - SD Files Written: 4 + FD Files Written: 0 + SD Files Written: 0 FD Bytes Written: 0 (0 B) - SD Bytes Written: 434 (434 B) + SD Bytes Written: 0 (0 B) Rate: 0.0 KB/s Software Compression: None - Comm Line Compression: 3.8% 1.0:1 + Comm Line Compression: None Snapshot/VSS: no Encryption: no Accurate: no - Volume name(s): A02106 - Volume Session Id: 19 - Volume Session Time: 1599755230 - Last Volume Bytes: 226,742,777,856 (226.7 GB) + Volume name(s): + Volume Session Id: 6 + Volume Session Time: 1601284581 + Last Volume Bytes: 419,424,897,024 (419.4 GB) Non-fatal FD errors: 0 SD Errors: 0 FD termination status: OK SD termination status: OK Termination: Backup OK -22-Sep 02:24 bacula-dir JobId 430: Begin pruning Jobs older than 30 years . -22-Sep 02:24 bacula-dir JobId 430: No Jobs found to prune. -22-Sep 02:24 bacula-dir JobId 430: Begin pruning Files. -22-Sep 02:24 bacula-dir JobId 430: No Files found to prune. -22-Sep 02:24 bacula-dir JobId 430: End auto prune. +29-Sep 02:23 bacula-dir JobId 444: Begin pruning Jobs older than 30 years . +29-Sep 02:23 bacula-dir JobId 444: No Jobs found to prune. +29-Sep 02:23 bacula-dir JobId 444: Begin pruning Files. +29-Sep 02:23 bacula-dir JobId 444: No Files found to prune. +29-Sep 02:23 bacula-dir JobId 444: End auto prune. diff --git a/Dir Config/scripts/webhooks/Christina-Bacula-Mail.md b/Dir Config/scripts/webhooks/Christina-Bacula-Mail.md index 8ae90f3..1fc792a 100644 --- a/Dir Config/scripts/webhooks/Christina-Bacula-Mail.md +++ b/Dir Config/scripts/webhooks/Christina-Bacula-Mail.md @@ -1,48 +1,48 @@ -22-Sep 02:24 bacula-dir JobId 432: Start Backup JobId 432, Job=Backup-Christina.2020-09-22_02.15.00_20 -22-Sep 02:24 bacula-dir JobId 432: Using Device "Drive-0-LTO-3" to write. -22-Sep 02:24 bacula-iron-sd JobId 432: Spooling data ... -22-Sep 02:32 bacula-iron-sd JobId 432: Committing spooled data to Volume "A02106". Despooling 10,218,102 bytes ... -22-Sep 02:32 bacula-iron-sd JobId 432: Despooling elapsed time = 00:00:01, Transfer rate = 10.21 M Bytes/second -22-Sep 02:32 bacula-iron-sd JobId 432: Elapsed time=00:08:07, Transfer rate=20.96 K Bytes/second -22-Sep 02:32 bacula-iron-sd JobId 432: Sending spooled attrs to the Director. Despooling 3,367 bytes ... -22-Sep 02:32 bacula-dir JobId 432: Bacula bacula-dir 9.4.2 (04Feb19): +29-Sep 02:23 bacula-dir JobId 446: Start Backup JobId 446, Job=Backup-Christina.2020-09-29_02.15.00_46 +29-Sep 02:23 bacula-dir JobId 446: Using Device "Drive-1-LTO-3" to write. +29-Sep 02:23 bacula-iron-sd JobId 446: Spooling data ... +29-Sep 02:34 bacula-iron-sd JobId 446: Committing spooled data to Volume "PF6866". Despooling 454 bytes ... +29-Sep 02:34 bacula-iron-sd JobId 446: Despooling elapsed time = 00:00:01, Transfer rate = 454 Bytes/second +29-Sep 02:34 bacula-iron-sd JobId 446: Elapsed time=00:10:37, Transfer rate=0 Bytes/second +29-Sep 02:34 bacula-iron-sd JobId 446: Sending spooled attrs to the Director. Despooling 0 bytes ... +29-Sep 02:34 bacula-dir JobId 446: Bacula bacula-dir 9.4.2 (04Feb19): Build OS: x86_64-pc-linux-gnu ubuntu 20.04 - JobId: 432 - Job: Backup-Christina.2020-09-22_02.15.00_20 - Backup Level: Incremental, since=2020-09-15 02:20:01 + JobId: 446 + Job: Backup-Christina.2020-09-29_02.15.00_46 + Backup Level: Incremental, since=2020-09-22 02:24:44 Client: "Zinc-Client" 9.6.3 (09Mar20) amd64-portbld-freebsd11.3,freebsd,11.3-RELEASE-p8 FileSet: "Christina Backup" 2020-08-25 02:15:00 Pool: "Incr-Pool" (From Job IncPool override) Catalog: "MyCatalog" (From Client resource) Storage: "Iron-Autochanger" (From Pool resource) - Scheduled time: 22-Sep-2020 02:15:00 - Start time: 22-Sep-2020 02:24:44 - End time: 22-Sep-2020 02:32:53 - Elapsed time: 8 mins 9 secs + Scheduled time: 29-Sep-2020 02:15:00 + Start time: 29-Sep-2020 02:23:58 + End time: 29-Sep-2020 02:34:37 + Elapsed time: 10 mins 39 secs Priority: 10 - FD Files Written: 16 - SD Files Written: 16 - FD Bytes Written: 10,205,589 (10.20 MB) - SD Bytes Written: 10,207,724 (10.20 MB) - Rate: 20.9 KB/s - Software Compression: 7.6% 1.1:1 + FD Files Written: 0 + SD Files Written: 0 + FD Bytes Written: 0 (0 B) + SD Bytes Written: 0 (0 B) + Rate: 0.0 KB/s + Software Compression: None Comm Line Compression: None Snapshot/VSS: no Encryption: no Accurate: no - Volume name(s): A02106 - Volume Session Id: 21 - Volume Session Time: 1599755230 - Last Volume Bytes: 226,753,099,776 (226.7 GB) + Volume name(s): + Volume Session Id: 8 + Volume Session Time: 1601284581 + Last Volume Bytes: 419,425,026,048 (419.4 GB) Non-fatal FD errors: 0 SD Errors: 0 FD termination status: OK SD termination status: OK Termination: Backup OK -22-Sep 02:32 bacula-dir JobId 432: Begin pruning Jobs older than 30 years . -22-Sep 02:32 bacula-dir JobId 432: No Jobs found to prune. -22-Sep 02:32 bacula-dir JobId 432: Begin pruning Files. -22-Sep 02:32 bacula-dir JobId 432: No Files found to prune. -22-Sep 02:32 bacula-dir JobId 432: End auto prune. +29-Sep 02:34 bacula-dir JobId 446: Begin pruning Jobs older than 30 years . +29-Sep 02:34 bacula-dir JobId 446: No Jobs found to prune. +29-Sep 02:34 bacula-dir JobId 446: Begin pruning Files. +29-Sep 02:34 bacula-dir JobId 446: No Files found to prune. +29-Sep 02:34 bacula-dir JobId 446: End auto prune. diff --git a/Dir Config/scripts/webhooks/FireBN-Bacula-Mail.md b/Dir Config/scripts/webhooks/FireBN-Bacula-Mail.md new file mode 100644 index 0000000..5965c87 --- /dev/null +++ b/Dir Config/scripts/webhooks/FireBN-Bacula-Mail.md @@ -0,0 +1,54 @@ +02-Oct 00:32 bacula-dir JobId 452: No prior Full backup Job record found. +02-Oct 00:32 bacula-dir JobId 452: No prior or suitable Full backup found in catalog. Doing FULL backup. +02-Oct 00:32 bacula-dir JobId 452: Start Backup JobId 452, Job=Backup-FireBN.2020-10-02_00.32.42_34 +02-Oct 00:32 bacula-dir JobId 452: Using Device "Drive-1-LTO-3" to write. +02-Oct 00:33 bacula-iron-sd JobId 452: 3304 Issuing autochanger "load Volume A00718, Slot 2, Drive 1" command. +02-Oct 00:33 bacula-iron-sd JobId 452: 3305 Autochanger "load Volume A00718, Slot 2, Drive 1", status is OK. +02-Oct 00:33 bacula-iron-sd JobId 452: Volume "A00718" previously written, moving to end of data. +02-Oct 00:37 bacula-iron-sd JobId 452: Ready to append to end of Volume "A00718" at file=86. +02-Oct 00:37 bacula-iron-sd JobId 452: Spooling data ... +02-Oct 00:38 bacula-iron-sd JobId 452: Committing spooled data to Volume "A00718". Despooling 16,131,821 bytes ... +02-Oct 00:38 bacula-iron-sd JobId 452: Despooling elapsed time = 00:00:01, Transfer rate = 16.13 M Bytes/second +02-Oct 00:38 bacula-iron-sd JobId 452: Elapsed time=00:00:02, Transfer rate=8.057 M Bytes/second +02-Oct 00:38 bacula-iron-sd JobId 452: Sending spooled attrs to the Director. Despooling 5,169 bytes ... +02-Oct 00:38 bacula-dir JobId 452: Bacula bacula-dir 9.4.2 (04Feb19): + Build OS: x86_64-pc-linux-gnu ubuntu 20.04 + JobId: 452 + Job: Backup-FireBN.2020-10-02_00.32.42_34 + Backup Level: Full (upgraded from Incremental) + Client: "Zinc-Client" 9.6.3 (09Mar20) amd64-portbld-freebsd11.3,freebsd,11.3-RELEASE-p8 + FileSet: "FireBN Backup" 2020-10-02 00:32:42 + Pool: "Full-Pool" (From Job FullPool override) + Catalog: "MyCatalog" (From Client resource) + Storage: "Iron-Autochanger" (From Pool resource) + Scheduled time: 02-Oct-2020 00:32:40 + Start time: 02-Oct-2020 00:32:45 + End time: 02-Oct-2020 00:38:04 + Elapsed time: 5 mins 19 secs + Priority: 10 + FD Files Written: 22 + SD Files Written: 22 + FD Bytes Written: 16,112,636 (16.11 MB) + SD Bytes Written: 16,115,677 (16.11 MB) + Rate: 50.5 KB/s + Software Compression: 5.8% 1.1:1 + Comm Line Compression: None + Snapshot/VSS: no + Encryption: no + Accurate: no + Volume name(s): A00718 + Volume Session Id: 13 + Volume Session Time: 1601284581 + Last Volume Bytes: 338,602,779,648 (338.6 GB) + Non-fatal FD errors: 0 + SD Errors: 0 + FD termination status: OK + SD termination status: OK + Termination: Backup OK + +02-Oct 00:38 bacula-dir JobId 452: Begin pruning Jobs older than 30 years . +02-Oct 00:38 bacula-dir JobId 452: No Jobs found to prune. +02-Oct 00:38 bacula-dir JobId 452: Begin pruning Files. +02-Oct 00:38 bacula-dir JobId 452: No Files found to prune. +02-Oct 00:38 bacula-dir JobId 452: End auto prune. + diff --git a/Dir Config/scripts/webhooks/FireBN-Bacula-Webhook.py b/Dir Config/scripts/webhooks/FireBN-Bacula-Webhook.py new file mode 100644 index 0000000..d36e125 --- /dev/null +++ b/Dir Config/scripts/webhooks/FireBN-Bacula-Webhook.py @@ -0,0 +1,12 @@ +from discord_webhook import DiscordWebhook, DiscordEmbed +from bathook import bathook + +webhookURL = "https://discordapp.com/api/webhooks/761445293932937246/sqPUm2RCG5jYLnCCVh13uDw-eXlyiVX0NssW9XOse6KXTnZwWcXFJ-c4gdOwBDO2QP1b" +maxCharPerMessage = 1994 + +bathook = bathook("/etc/bacula/scripts/webhooks/FireBN-Bacula-Mail.md", "FireBN") + +for message_part in bathook.get_formatted_message(): # For every message part in the truncated output, run this loop + webhook = DiscordWebhook(url=webhookURL, username="Vixi's Nextcloud-Bacula Daemon") # Attach the message + webhook.add_embed(bathook.get_discord_embed()) + response = webhook.execute() # Hit send \ No newline at end of file diff --git a/Dir Config/scripts/webhooks/Julio-Bacula-Mail.md b/Dir Config/scripts/webhooks/Julio-Bacula-Mail.md index 508fda4..30b0af6 100644 --- a/Dir Config/scripts/webhooks/Julio-Bacula-Mail.md +++ b/Dir Config/scripts/webhooks/Julio-Bacula-Mail.md @@ -1,23 +1,23 @@ -22-Sep 02:30 bacula-dir JobId 433: Start Backup JobId 433, Job=Backup-Julio.2020-09-22_02.15.00_21 -22-Sep 02:30 bacula-dir JobId 433: Using Device "Drive-1-LTO-3" to write. -22-Sep 02:30 bacula-iron-sd JobId 433: Spooling data ... -22-Sep 02:30 bacula-iron-sd JobId 433: Committing spooled data to Volume "PF6866". Despooling 430 bytes ... -22-Sep 02:30 bacula-iron-sd JobId 433: Despooling elapsed time = 00:00:01, Transfer rate = 430 Bytes/second -22-Sep 02:30 bacula-iron-sd JobId 433: Elapsed time=00:00:01, Transfer rate=0 Bytes/second -22-Sep 02:30 bacula-iron-sd JobId 433: Sending spooled attrs to the Director. Despooling 0 bytes ... -22-Sep 02:30 bacula-dir JobId 433: Bacula bacula-dir 9.4.2 (04Feb19): +29-Sep 02:29 bacula-dir JobId 447: Start Backup JobId 447, Job=Backup-Julio.2020-09-29_02.15.00_47 +29-Sep 02:29 bacula-dir JobId 447: Using Device "Drive-0-LTO-3" to write. +29-Sep 02:29 bacula-iron-sd JobId 447: Spooling data ... +29-Sep 02:29 bacula-iron-sd JobId 447: Committing spooled data to Volume "A02106". Despooling 430 bytes ... +29-Sep 02:29 bacula-iron-sd JobId 447: Despooling elapsed time = 00:00:01, Transfer rate = 430 Bytes/second +29-Sep 02:29 bacula-iron-sd JobId 447: Elapsed time=00:00:01, Transfer rate=0 Bytes/second +29-Sep 02:29 bacula-iron-sd JobId 447: Sending spooled attrs to the Director. Despooling 0 bytes ... +29-Sep 02:29 bacula-dir JobId 447: Bacula bacula-dir 9.4.2 (04Feb19): Build OS: x86_64-pc-linux-gnu ubuntu 20.04 - JobId: 433 - Job: Backup-Julio.2020-09-22_02.15.00_21 - Backup Level: Incremental, since=2020-09-15 02:26:09 + JobId: 447 + Job: Backup-Julio.2020-09-29_02.15.00_47 + Backup Level: Incremental, since=2020-09-22 02:30:44 Client: "Zinc-Client" 9.6.3 (09Mar20) amd64-portbld-freebsd11.3,freebsd,11.3-RELEASE-p8 FileSet: "Julio Backup" 2020-09-01 02:15:00 Pool: "Incr-Pool" (From Job IncPool override) Catalog: "MyCatalog" (From Client resource) Storage: "Iron-Autochanger" (From Pool resource) - Scheduled time: 22-Sep-2020 02:15:00 - Start time: 22-Sep-2020 02:30:44 - End time: 22-Sep-2020 02:30:47 + Scheduled time: 29-Sep-2020 02:15:00 + Start time: 29-Sep-2020 02:29:38 + End time: 29-Sep-2020 02:29:41 Elapsed time: 3 secs Priority: 10 FD Files Written: 0 @@ -31,18 +31,18 @@ Encryption: no Accurate: no Volume name(s): - Volume Session Id: 22 - Volume Session Time: 1599755230 - Last Volume Bytes: 334,008,428,544 (334.0 GB) + Volume Session Id: 9 + Volume Session Time: 1601284581 + Last Volume Bytes: 227,983,472,640 (227.9 GB) Non-fatal FD errors: 0 SD Errors: 0 FD termination status: OK SD termination status: OK - Termination: Backup O + Termination: Backup OK -22-Sep 02:30 bacula-dir JobId 433: Begin pruning Jobs older than 30 years . -22-Sep 02:30 bacula-dir JobId 433: No Jobs found to prune. -22-Sep 02:30 bacula-dir JobId 433: Begin pruning Files. -22-Sep 02:30 bacula-dir JobId 433: No Files found to prune. -22-Sep 02:30 bacula-dir JobId 433: End auto prune. +29-Sep 02:29 bacula-dir JobId 447: Begin pruning Jobs older than 30 years . +29-Sep 02:29 bacula-dir JobId 447: No Jobs found to prune. +29-Sep 02:29 bacula-dir JobId 447: Begin pruning Files. +29-Sep 02:29 bacula-dir JobId 447: No Files found to prune. +29-Sep 02:29 bacula-dir JobId 447: End auto prune. diff --git a/Dir Config/scripts/webhooks/RoboticsMail.md b/Dir Config/scripts/webhooks/RoboticsMail.md index f55c28d..ef03faa 100644 --- a/Dir Config/scripts/webhooks/RoboticsMail.md +++ b/Dir Config/scripts/webhooks/RoboticsMail.md @@ -1,48 +1,48 @@ -22-Sep 02:32 bacula-dir JobId 435: Start Backup JobId 435, Job=Backup-Robotics.2020-09-22_02.15.00_23 -22-Sep 02:32 bacula-dir JobId 435: Using Device "Drive-0-LTO-3" to write. -22-Sep 02:32 bacula-iron-sd JobId 435: Spooling data ... -22-Sep 02:33 bacula-iron-sd JobId 435: Committing spooled data to Volume "A02106". Despooling 50,889 bytes ... -22-Sep 02:33 bacula-iron-sd JobId 435: Despooling elapsed time = 00:00:01, Transfer rate = 50.88 K Bytes/second -22-Sep 02:33 bacula-iron-sd JobId 435: Elapsed time=00:00:08, Transfer rate=6.273 K Bytes/second -22-Sep 02:33 bacula-iron-sd JobId 435: Sending spooled attrs to the Director. Despooling 2,126 bytes ... -22-Sep 02:33 bacula-dir JobId 435: Bacula bacula-dir 9.4.2 (04Feb19): +29-Sep 02:34 bacula-dir JobId 450: Start Backup JobId 450, Job=Backup-Robotics.2020-09-29_02.15.00_50 +29-Sep 02:34 bacula-dir JobId 450: Using Device "Drive-1-LTO-3" to write. +29-Sep 02:34 bacula-iron-sd JobId 450: Spooling data ... +29-Sep 02:34 bacula-iron-sd JobId 450: Committing spooled data to Volume "PF6866". Despooling 14,575 bytes ... +29-Sep 02:34 bacula-iron-sd JobId 450: Despooling elapsed time = 00:00:01, Transfer rate = 14.57 K Bytes/second +29-Sep 02:34 bacula-iron-sd JobId 450: Elapsed time=00:00:09, Transfer rate=1.560 K Bytes/second +29-Sep 02:34 bacula-iron-sd JobId 450: Sending spooled attrs to the Director. Despooling 521 bytes ... +29-Sep 02:34 bacula-dir JobId 450: Bacula bacula-dir 9.4.2 (04Feb19): Build OS: x86_64-pc-linux-gnu ubuntu 20.04 - JobId: 435 - Job: Backup-Robotics.2020-09-22_02.15.00_23 - Backup Level: Incremental, since=2020-09-15 02:26:13 + JobId: 450 + Job: Backup-Robotics.2020-09-29_02.15.00_50 + Backup Level: Incremental, since=2020-09-22 02:32:54 Client: "Zinc-Client" 9.6.3 (09Mar20) amd64-portbld-freebsd11.3,freebsd,11.3-RELEASE-p8 FileSet: "Google-Drive Robotics" 2020-08-05 15:36:42 Pool: "Incr-Pool" (From Job IncPool override) Catalog: "MyCatalog" (From Client resource) Storage: "Iron-Autochanger" (From Pool resource) - Scheduled time: 22-Sep-2020 02:15:00 - Start time: 22-Sep-2020 02:32:54 - End time: 22-Sep-2020 02:33:04 + Scheduled time: 29-Sep-2020 02:15:00 + Start time: 29-Sep-2020 02:34:38 + End time: 29-Sep-2020 02:34:48 Elapsed time: 10 secs Priority: 10 - FD Files Written: 10 - SD Files Written: 10 - FD Bytes Written: 48,903 (48.90 KB) - SD Bytes Written: 50,189 (50.18 KB) - Rate: 4.9 KB/s + FD Files Written: 2 + SD Files Written: 2 + FD Bytes Written: 13,746 (13.74 KB) + SD Bytes Written: 14,043 (14.04 KB) + Rate: 1.4 KB/s Software Compression: None - Comm Line Compression: 6.5% 1.1:1 + Comm Line Compression: 10.2% 1.1:1 Snapshot/VSS: no Encryption: no Accurate: no - Volume name(s): A02106 - Volume Session Id: 24 - Volume Session Time: 1599755230 - Last Volume Bytes: 226,753,164,288 (226.7 GB) + Volume name(s): PF6866 + Volume Session Id: 12 + Volume Session Time: 1601284581 + Last Volume Bytes: 419,425,090,560 (419.4 GB) Non-fatal FD errors: 0 SD Errors: 0 FD termination status: OK SD termination status: OK Termination: Backup OK -22-Sep 02:33 bacula-dir JobId 435: Begin pruning Jobs older than 30 years . -22-Sep 02:33 bacula-dir JobId 435: No Jobs found to prune. -22-Sep 02:33 bacula-dir JobId 435: Begin pruning Files. -22-Sep 02:33 bacula-dir JobId 435: No Files found to prune. -22-Sep 02:33 bacula-dir JobId 435: End auto prune. +29-Sep 02:34 bacula-dir JobId 450: Begin pruning Jobs older than 30 years . +29-Sep 02:34 bacula-dir JobId 450: No Jobs found to prune. +29-Sep 02:34 bacula-dir JobId 450: Begin pruning Files. +29-Sep 02:34 bacula-dir JobId 450: No Files found to prune. +29-Sep 02:34 bacula-dir JobId 450: End auto prune. diff --git a/Dir Config/scripts/webhooks/__pycache__/bathook.cpython-38.pyc b/Dir Config/scripts/webhooks/__pycache__/bathook.cpython-38.pyc index e29b3ae..9e40bce 100644 Binary files a/Dir Config/scripts/webhooks/__pycache__/bathook.cpython-38.pyc and b/Dir Config/scripts/webhooks/__pycache__/bathook.cpython-38.pyc differ diff --git a/Dir Config/scripts/webhooks/bathook.py b/Dir Config/scripts/webhooks/bathook.py index 9235be9..73ec150 100644 --- a/Dir Config/scripts/webhooks/bathook.py +++ b/Dir Config/scripts/webhooks/bathook.py @@ -58,7 +58,7 @@ Backup took {5} And used {6} bytes.""".format(self.jobname, self.jobid, self.dat headerdesc = "The most recent backup did not complete, or completed with errors, the fill report will still not be shown." self.embed = DiscordEmbed(title="Tape Job Results", description=headerdesc, color=headercolor) - self.embed.set_author(name="Snowsune's Tape Daemon", url="https://kitsunehosting.net/", icon_url="https://kitsunehosting.net/nextcloud/index.php/apps/files_sharing/publicpreview/zzygHFxJQXjXxMz?x=1920&y=553&a=true&file=TapeImage.JPG&scalingup=0") + self.embed.set_author(name="Tape Daemon", url="https://kitsunehosting.net/", icon_url="https://kitsunehosting.net/nextcloud/index.php/apps/files_sharing/publicpreview/zzygHFxJQXjXxMz?x=1920&y=553&a=true&file=TapeImage.JPG&scalingup=0") self.embed.set_timestamp() self.embed.add_embed_field(name="End Time", value=self.endtime) self.embed.add_embed_field(name="Elapsed Time", value=self.elapsedtime)