Change into bacula-dir directory
This is to avoid using weird git features when enabling git on the host.
This commit is contained in:
BIN
scripts/webhooks/._sync_25af217b4a41.db
Normal file
BIN
scripts/webhooks/._sync_25af217b4a41.db
Normal file
Binary file not shown.
BIN
scripts/webhooks/._sync_25af217b4a41.db-shm
Normal file
BIN
scripts/webhooks/._sync_25af217b4a41.db-shm
Normal file
Binary file not shown.
BIN
scripts/webhooks/._sync_25af217b4a41.db-wal
Normal file
BIN
scripts/webhooks/._sync_25af217b4a41.db-wal
Normal file
Binary file not shown.
BIN
scripts/webhooks/._sync_3f5c94a4c959.db
Normal file
BIN
scripts/webhooks/._sync_3f5c94a4c959.db
Normal file
Binary file not shown.
BIN
scripts/webhooks/._sync_5697f62b8a60.db
Normal file
BIN
scripts/webhooks/._sync_5697f62b8a60.db
Normal file
Binary file not shown.
48
scripts/webhooks/Aidan-Bacula-Mail.md
Normal file
48
scripts/webhooks/Aidan-Bacula-Mail.md
Normal file
@@ -0,0 +1,48 @@
|
||||
01-Nov 07:52 bacula-dir JobId 535: Start Backup JobId 535, Job=Backup-Aidan.2020-11-01_02.15.01_32
|
||||
01-Nov 07:52 bacula-dir JobId 535: Using Device "Drive-0-LTO-3" to write.
|
||||
01-Nov 07:52 bacula-iron-sd JobId 535: Spooling data ...
|
||||
01-Nov 07:52 bacula-iron-sd JobId 535: Committing spooled data to Volume "PE5125". Despooling 430 bytes ...
|
||||
01-Nov 07:52 bacula-iron-sd JobId 535: Despooling elapsed time = 00:00:01, Transfer rate = 430 Bytes/second
|
||||
01-Nov 07:52 bacula-iron-sd JobId 535: Elapsed time=00:00:01, Transfer rate=0 Bytes/second
|
||||
01-Nov 07:52 bacula-iron-sd JobId 535: Sending spooled attrs to the Director. Despooling 0 bytes ...
|
||||
01-Nov 07:52 bacula-dir JobId 535: Bacula bacula-dir 9.4.2 (04Feb19):
|
||||
Build OS: x86_64-pc-linux-gnu ubuntu 20.04
|
||||
JobId: 535
|
||||
Job: Backup-Aidan.2020-11-01_02.15.01_32
|
||||
Backup Level: Differential, since=2020-10-04 21:37:11
|
||||
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: "Diff-Pool" (From Job DiffPool override)
|
||||
Catalog: "MyCatalog" (From Client resource)
|
||||
Storage: "Iron-Autochanger" (From Pool resource)
|
||||
Scheduled time: 01-Nov-2020 02:15:01
|
||||
Start time: 01-Nov-2020 07:52:46
|
||||
End time: 01-Nov-2020 07:52:48
|
||||
Elapsed time: 2 secs
|
||||
Priority: 10
|
||||
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):
|
||||
Volume Session Id: 89
|
||||
Volume Session Time: 1601284581
|
||||
Last Volume Bytes: 194,796,887,040 (194.7 GB)
|
||||
Non-fatal FD errors: 0
|
||||
SD Errors: 0
|
||||
FD termination status: OK
|
||||
SD termination status: OK
|
||||
Termination: Backup OK
|
||||
|
||||
01-Nov 07:52 bacula-dir JobId 535: Begin pruning Jobs older than 30 years .
|
||||
01-Nov 07:52 bacula-dir JobId 535: No Jobs found to prune.
|
||||
01-Nov 07:52 bacula-dir JobId 535: Begin pruning Files.
|
||||
01-Nov 07:52 bacula-dir JobId 535: No Files found to prune.
|
||||
01-Nov 07:52 bacula-dir JobId 535: End auto prune.
|
||||
|
||||
23
scripts/webhooks/Aidan-Bacula-Webhook.py
Normal file
23
scripts/webhooks/Aidan-Bacula-Webhook.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from discord_webhook import DiscordWebhook, DiscordEmbed
|
||||
from bathook import bathook
|
||||
|
||||
webhookURL = "https://discordapp.com/api/webhooks/758550057598582804/DogsHl5AEKwMr01LJ_ddSUuAZcfW2eCEybZDGFjBUMIBKTVXCvD7D2d2I6zDNaoQNu1j"
|
||||
maxCharPerMessage = 1994
|
||||
|
||||
bathook = bathook("/etc/bacula/scripts/webhooks/Aidan-Bacula-Mail.md", "SporkMC (and mounted storages)")
|
||||
|
||||
for message_part in bathook.get_formatted_message(): # For every message part in the truncated output, run this loop
|
||||
# Form the embedded stuff (unique for aidan's server)
|
||||
#embed = DiscordEmbed()
|
||||
#embed.set_author(name="Snowsune's Tape Daemon", icon_url="https://kitsunehosting.net/nextcloud/index.php/apps/files_sharing/publicpreview/zzygHFxJQXjXxMz?x=1920&y=553&a=true&file=TapeImage.JPG&scalingup=0")
|
||||
#embed.set_timestamp()
|
||||
#embed.add_embed_field(name='Field 1', value='Lorem ipsum')
|
||||
|
||||
#message_part = "```" + message_part + "```" # Encapsulate the messsage
|
||||
#print(message_part)
|
||||
#webhook = DiscordWebhook(url=webhookURL, username="Snowsune's SporkMC Bacula Daemon", content=message_part) # Attach the message
|
||||
#webhook.add_embed(embed)
|
||||
#response = webhook.execute() # Hit send
|
||||
webhook = DiscordWebhook(url=webhookURL, username="Snowsune's Nextcloud-Bacula Daemon") # Attach the message
|
||||
webhook.add_embed(bathook.get_discord_embed())
|
||||
response = webhook.execute() # Hit send
|
||||
16
scripts/webhooks/ChrisProElite-Bacula-Webhook.py
Normal file
16
scripts/webhooks/ChrisProElite-Bacula-Webhook.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from discord_webhook import DiscordWebhook
|
||||
from bathook import bathook
|
||||
|
||||
webhookURL = "https://discordapp.com/api/webhooks/742784012640190565/NBhtbWpDdgMZPx7uCXO8Ofw-o8Lez0V17EBGIvYv7FTIeTENK24GHNL3krUbYnOOIJ63"
|
||||
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.add_embed(bathook.get_discord_embed())
|
||||
response = webhook.execute() # Hit send
|
||||
#message_part = "```" + message_part + "```" # Encapsulate the messsage
|
||||
#print(message_part)
|
||||
#webhook = DiscordWebhook(url=webhookURL, content=message_part) # Attach the message
|
||||
#response = webhook.execute() # Hit send
|
||||
64
scripts/webhooks/ChrisProEliteMail.md
Normal file
64
scripts/webhooks/ChrisProEliteMail.md
Normal file
@@ -0,0 +1,64 @@
|
||||
01-Nov 05:26 bacula-dir JobId 531: Start Backup JobId 531, Job=Backup-Chris.2020-11-01_02.15.01_28
|
||||
01-Nov 05:26 bacula-dir JobId 531: Using Device "Drive-0-LTO-3" to write.
|
||||
01-Nov 05:26 bacula-iron-sd JobId 531: Spooling data ...
|
||||
01-Nov 06:06 bacula-iron-sd JobId 531: User specified Job spool size reached: JobSpoolSize=10,737,438,025 MaxJobSpoolSize=10,737,418,240
|
||||
01-Nov 06:06 bacula-iron-sd JobId 531: Writing spooled data to Volume. Despooling 10,737,438,025 bytes ...
|
||||
01-Nov 06:14 bacula-iron-sd JobId 531: Despooling elapsed time = 00:08:12, Transfer rate = 21.82 M Bytes/second
|
||||
01-Nov 06:14 bacula-iron-sd JobId 531: Spooling data again ...
|
||||
01-Nov 06:22 bacula-iron-sd JobId 531: User specified Job spool size reached: JobSpoolSize=10,737,438,668 MaxJobSpoolSize=10,737,418,240
|
||||
01-Nov 06:22 bacula-iron-sd JobId 531: Writing spooled data to Volume. Despooling 10,737,438,668 bytes ...
|
||||
01-Nov 06:29 bacula-iron-sd JobId 531: Despooling elapsed time = 00:06:40, Transfer rate = 26.84 M Bytes/second
|
||||
01-Nov 06:29 bacula-iron-sd JobId 531: Spooling data again ...
|
||||
01-Nov 06:37 bacula-iron-sd JobId 531: User specified Job spool size reached: JobSpoolSize=10,737,438,647 MaxJobSpoolSize=10,737,418,240
|
||||
01-Nov 06:37 bacula-iron-sd JobId 531: Writing spooled data to Volume. Despooling 10,737,438,647 bytes ...
|
||||
01-Nov 06:42 bacula-iron-sd JobId 531: Despooling elapsed time = 00:05:27, Transfer rate = 32.83 M Bytes/second
|
||||
01-Nov 06:42 bacula-iron-sd JobId 531: Spooling data again ...
|
||||
01-Nov 06:49 bacula-iron-sd JobId 531: User specified Job spool size reached: JobSpoolSize=10,737,438,695 MaxJobSpoolSize=10,737,418,240
|
||||
01-Nov 06:49 bacula-iron-sd JobId 531: Writing spooled data to Volume. Despooling 10,737,438,695 bytes ...
|
||||
01-Nov 06:54 bacula-iron-sd JobId 531: Despooling elapsed time = 00:05:09, Transfer rate = 34.74 M Bytes/second
|
||||
01-Nov 06:55 bacula-iron-sd JobId 531: Spooling data again ...
|
||||
01-Nov 07:08 bacula-iron-sd JobId 531: Committing spooled data to Volume "PE5125". Despooling 5,914,233,985 bytes ...
|
||||
01-Nov 07:11 bacula-iron-sd JobId 531: Despooling elapsed time = 00:02:40, Transfer rate = 36.96 M Bytes/second
|
||||
01-Nov 07:11 bacula-iron-sd JobId 531: Elapsed time=01:44:44, Transfer rate=7.766 M Bytes/second
|
||||
01-Nov 07:11 bacula-iron-sd JobId 531: Sending spooled attrs to the Director. Despooling 83,597,578 bytes ...
|
||||
01-Nov 07:11 bacula-dir JobId 531: Bacula bacula-dir 9.4.2 (04Feb19):
|
||||
Build OS: x86_64-pc-linux-gnu ubuntu 20.04
|
||||
JobId: 531
|
||||
Job: Backup-Chris.2020-11-01_02.15.01_28
|
||||
Backup Level: Differential, since=2020-10-04 13:06:17
|
||||
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: "Diff-Pool" (From Job DiffPool override)
|
||||
Catalog: "MyCatalog" (From Client resource)
|
||||
Storage: "Iron-Autochanger" (From Pool resource)
|
||||
Scheduled time: 01-Nov-2020 02:15:01
|
||||
Start time: 01-Nov-2020 05:26:44
|
||||
End time: 01-Nov-2020 07:11:51
|
||||
Elapsed time: 1 hour 45 mins 7 secs
|
||||
Priority: 10
|
||||
FD Files Written: 264,661
|
||||
SD Files Written: 264,661
|
||||
FD Bytes Written: 48,751,972,776 (48.75 GB)
|
||||
SD Bytes Written: 48,807,529,474 (48.80 GB)
|
||||
Rate: 7729.8 KB/s
|
||||
Software Compression: 21.3% 1.3:1
|
||||
Comm Line Compression: 0.9% 1.0:1
|
||||
Snapshot/VSS: no
|
||||
Encryption: no
|
||||
Accurate: no
|
||||
Volume name(s): PE5125
|
||||
Volume Session Id: 85
|
||||
Volume Session Time: 1601284581
|
||||
Last Volume Bytes: 162,657,202,176 (162.6 GB)
|
||||
Non-fatal FD errors: 0
|
||||
SD Errors: 0
|
||||
FD termination status: OK
|
||||
SD termination status: OK
|
||||
Termination: Backup OK
|
||||
|
||||
01-Nov 07:11 bacula-dir JobId 531: Begin pruning Jobs older than 30 years .
|
||||
01-Nov 07:11 bacula-dir JobId 531: No Jobs found to prune.
|
||||
01-Nov 07:11 bacula-dir JobId 531: Begin pruning Files.
|
||||
01-Nov 07:11 bacula-dir JobId 531: No Files found to prune.
|
||||
01-Nov 07:11 bacula-dir JobId 531: End auto prune.
|
||||
|
||||
56
scripts/webhooks/Christina-Bacula-Mail.md
Normal file
56
scripts/webhooks/Christina-Bacula-Mail.md
Normal file
@@ -0,0 +1,56 @@
|
||||
01-Nov 07:11 bacula-dir JobId 533: Start Backup JobId 533, Job=Backup-Christina.2020-11-01_02.15.01_30
|
||||
01-Nov 07:11 bacula-dir JobId 533: Using Device "Drive-0-LTO-3" to write.
|
||||
01-Nov 07:11 bacula-iron-sd JobId 533: Spooling data ...
|
||||
01-Nov 07:23 bacula-iron-sd JobId 533: User specified Job spool size reached: JobSpoolSize=10,737,438,664 MaxJobSpoolSize=10,737,418,240
|
||||
01-Nov 07:23 bacula-iron-sd JobId 533: Writing spooled data to Volume. Despooling 10,737,438,664 bytes ...
|
||||
01-Nov 07:27 bacula-iron-sd JobId 533: Despooling elapsed time = 00:04:22, Transfer rate = 40.98 M Bytes/second
|
||||
01-Nov 07:27 bacula-iron-sd JobId 533: Spooling data again ...
|
||||
01-Nov 07:34 bacula-iron-sd JobId 533: User specified Job spool size reached: JobSpoolSize=10,737,438,689 MaxJobSpoolSize=10,737,418,240
|
||||
01-Nov 07:34 bacula-iron-sd JobId 533: Writing spooled data to Volume. Despooling 10,737,438,689 bytes ...
|
||||
01-Nov 07:39 bacula-iron-sd JobId 533: Despooling elapsed time = 00:05:00, Transfer rate = 35.79 M Bytes/second
|
||||
01-Nov 07:39 bacula-iron-sd JobId 533: Spooling data again ...
|
||||
01-Nov 07:48 bacula-iron-sd JobId 533: Committing spooled data to Volume "PE5125". Despooling 10,670,666,561 bytes ...
|
||||
01-Nov 07:52 bacula-iron-sd JobId 533: Despooling elapsed time = 00:04:28, Transfer rate = 39.81 M Bytes/second
|
||||
01-Nov 07:52 bacula-iron-sd JobId 533: Elapsed time=00:40:47, Transfer rate=13.12 M Bytes/second
|
||||
01-Nov 07:52 bacula-iron-sd JobId 533: Sending spooled attrs to the Director. Despooling 1,447 bytes ...
|
||||
01-Nov 07:52 bacula-dir JobId 533: Bacula bacula-dir 9.4.2 (04Feb19):
|
||||
Build OS: x86_64-pc-linux-gnu ubuntu 20.04
|
||||
JobId: 533
|
||||
Job: Backup-Christina.2020-11-01_02.15.01_30
|
||||
Backup Level: Differential, since=2020-10-04 13:09:46
|
||||
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: "Diff-Pool" (From Job DiffPool override)
|
||||
Catalog: "MyCatalog" (From Client resource)
|
||||
Storage: "Iron-Autochanger" (From Pool resource)
|
||||
Scheduled time: 01-Nov-2020 02:15:01
|
||||
Start time: 01-Nov-2020 07:11:55
|
||||
End time: 01-Nov-2020 07:52:42
|
||||
Elapsed time: 40 mins 47 secs
|
||||
Priority: 10
|
||||
FD Files Written: 7
|
||||
SD Files Written: 7
|
||||
FD Bytes Written: 32,115,622,157 (32.11 GB)
|
||||
SD Bytes Written: 32,115,623,044 (32.11 GB)
|
||||
Rate: 13124.5 KB/s
|
||||
Software Compression: None
|
||||
Comm Line Compression: None
|
||||
Snapshot/VSS: no
|
||||
Encryption: no
|
||||
Accurate: no
|
||||
Volume name(s): PE5125
|
||||
Volume Session Id: 87
|
||||
Volume Session Time: 1601284581
|
||||
Last Volume Bytes: 194,796,758,016 (194.7 GB)
|
||||
Non-fatal FD errors: 0
|
||||
SD Errors: 0
|
||||
FD termination status: OK
|
||||
SD termination status: OK
|
||||
Termination: Backup OK
|
||||
|
||||
01-Nov 07:52 bacula-dir JobId 533: Begin pruning Jobs older than 30 years .
|
||||
01-Nov 07:52 bacula-dir JobId 533: No Jobs found to prune.
|
||||
01-Nov 07:52 bacula-dir JobId 533: Begin pruning Files.
|
||||
01-Nov 07:52 bacula-dir JobId 533: No Files found to prune.
|
||||
01-Nov 07:52 bacula-dir JobId 533: End auto prune.
|
||||
|
||||
48
scripts/webhooks/FireBN-Bacula-Mail.md
Normal file
48
scripts/webhooks/FireBN-Bacula-Mail.md
Normal file
@@ -0,0 +1,48 @@
|
||||
01-Nov 07:52 bacula-dir JobId 536: Start Backup JobId 536, Job=Backup-FireBN.2020-11-01_02.15.01_33
|
||||
01-Nov 07:52 bacula-dir JobId 536: Using Device "Drive-0-LTO-3" to write.
|
||||
01-Nov 07:52 bacula-iron-sd JobId 536: Spooling data ...
|
||||
01-Nov 07:52 bacula-iron-sd JobId 536: Committing spooled data to Volume "PE5125". Despooling 44,033,605 bytes ...
|
||||
01-Nov 07:52 bacula-iron-sd JobId 536: Despooling elapsed time = 00:00:01, Transfer rate = 44.03 M Bytes/second
|
||||
01-Nov 07:52 bacula-iron-sd JobId 536: Elapsed time=00:00:03, Transfer rate=14.66 M Bytes/second
|
||||
01-Nov 07:52 bacula-iron-sd JobId 536: Sending spooled attrs to the Director. Despooling 4,237 bytes ...
|
||||
01-Nov 07:52 bacula-dir JobId 536: Bacula bacula-dir 9.4.2 (04Feb19):
|
||||
Build OS: x86_64-pc-linux-gnu ubuntu 20.04
|
||||
JobId: 536
|
||||
Job: Backup-FireBN.2020-11-01_02.15.01_33
|
||||
Backup Level: Differential, since=2020-10-04 21:37:15
|
||||
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: "Diff-Pool" (From Job DiffPool override)
|
||||
Catalog: "MyCatalog" (From Client resource)
|
||||
Storage: "Iron-Autochanger" (From Pool resource)
|
||||
Scheduled time: 01-Nov-2020 02:15:01
|
||||
Start time: 01-Nov-2020 07:52:49
|
||||
End time: 01-Nov-2020 07:52:54
|
||||
Elapsed time: 5 secs
|
||||
Priority: 10
|
||||
FD Files Written: 20
|
||||
SD Files Written: 20
|
||||
FD Bytes Written: 43,989,160 (43.98 MB)
|
||||
SD Bytes Written: 43,991,829 (43.99 MB)
|
||||
Rate: 8797.8 KB/s
|
||||
Software Compression: 1.9% 1.0:1
|
||||
Comm Line Compression: None
|
||||
Snapshot/VSS: no
|
||||
Encryption: no
|
||||
Accurate: no
|
||||
Volume name(s): PE5125
|
||||
Volume Session Id: 90
|
||||
Volume Session Time: 1601284581
|
||||
Last Volume Bytes: 194,840,948,736 (194.8 GB)
|
||||
Non-fatal FD errors: 0
|
||||
SD Errors: 0
|
||||
FD termination status: OK
|
||||
SD termination status: OK
|
||||
Termination: Backup OK
|
||||
|
||||
01-Nov 07:52 bacula-dir JobId 536: Begin pruning Jobs older than 30 years .
|
||||
01-Nov 07:52 bacula-dir JobId 536: No Jobs found to prune.
|
||||
01-Nov 07:52 bacula-dir JobId 536: Begin pruning Files.
|
||||
01-Nov 07:52 bacula-dir JobId 536: No Files found to prune.
|
||||
01-Nov 07:52 bacula-dir JobId 536: End auto prune.
|
||||
|
||||
12
scripts/webhooks/FireBN-Bacula-Webhook.py
Normal file
12
scripts/webhooks/FireBN-Bacula-Webhook.py
Normal file
@@ -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
|
||||
48
scripts/webhooks/Julio-Bacula-Mail.md
Normal file
48
scripts/webhooks/Julio-Bacula-Mail.md
Normal file
@@ -0,0 +1,48 @@
|
||||
01-Nov 07:52 bacula-dir JobId 534: Start Backup JobId 534, Job=Backup-Julio.2020-11-01_02.15.01_31
|
||||
01-Nov 07:52 bacula-dir JobId 534: Using Device "Drive-0-LTO-3" to write.
|
||||
01-Nov 07:52 bacula-iron-sd JobId 534: Spooling data ...
|
||||
01-Nov 07:52 bacula-iron-sd JobId 534: Committing spooled data to Volume "PE5125". Despooling 14,257 bytes ...
|
||||
01-Nov 07:52 bacula-iron-sd JobId 534: Despooling elapsed time = 00:00:01, Transfer rate = 14.25 K Bytes/second
|
||||
01-Nov 07:52 bacula-iron-sd JobId 534: Elapsed time=00:00:01, Transfer rate=13.74 K Bytes/second
|
||||
01-Nov 07:52 bacula-iron-sd JobId 534: Sending spooled attrs to the Director. Despooling 772 bytes ...
|
||||
01-Nov 07:52 bacula-dir JobId 534: Bacula bacula-dir 9.4.2 (04Feb19):
|
||||
Build OS: x86_64-pc-linux-gnu ubuntu 20.04
|
||||
JobId: 534
|
||||
Job: Backup-Julio.2020-11-01_02.15.01_31
|
||||
Backup Level: Differential, since=2020-10-04 21:19:13
|
||||
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: "Diff-Pool" (From Job DiffPool override)
|
||||
Catalog: "MyCatalog" (From Client resource)
|
||||
Storage: "Iron-Autochanger" (From Pool resource)
|
||||
Scheduled time: 01-Nov-2020 02:15:01
|
||||
Start time: 01-Nov-2020 07:52:43
|
||||
End time: 01-Nov-2020 07:52:46
|
||||
Elapsed time: 3 secs
|
||||
Priority: 10
|
||||
FD Files Written: 4
|
||||
SD Files Written: 4
|
||||
FD Bytes Written: 13,251 (13.25 KB)
|
||||
SD Bytes Written: 13,743 (13.74 KB)
|
||||
Rate: 4.4 KB/s
|
||||
Software Compression: 81.5% 5.4:1
|
||||
Comm Line Compression: 1.4% 1.0:1
|
||||
Snapshot/VSS: no
|
||||
Encryption: no
|
||||
Accurate: no
|
||||
Volume name(s): PE5125
|
||||
Volume Session Id: 88
|
||||
Volume Session Time: 1601284581
|
||||
Last Volume Bytes: 194,796,822,528 (194.7 GB)
|
||||
Non-fatal FD errors: 0
|
||||
SD Errors: 0
|
||||
FD termination status: OK
|
||||
SD termination status: OK
|
||||
Termination: Backup OK
|
||||
|
||||
01-Nov 07:52 bacula-dir JobId 534: Begin pruning Jobs older than 30 years .
|
||||
01-Nov 07:52 bacula-dir JobId 534: No Jobs found to prune.
|
||||
01-Nov 07:52 bacula-dir JobId 534: Begin pruning Files.
|
||||
01-Nov 07:52 bacula-dir JobId 534: No Files found to prune.
|
||||
01-Nov 07:52 bacula-dir JobId 534: End auto prune.
|
||||
|
||||
12
scripts/webhooks/NewImprovedBot.py
Normal file
12
scripts/webhooks/NewImprovedBot.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from discord_webhook import DiscordWebhook, DiscordEmbed
|
||||
from bathook import bathook
|
||||
|
||||
webhookURL = "https://discordapp.com/api/webhooks/758548414962073670/RsBq2Tex4_mh7mAu_otYzlabW0mFHkcSxnyW4MNl6hFniagT6EEACEPLB9mtIt76NY81"
|
||||
maxCharPerMessage = 1994
|
||||
|
||||
bathook = bathook("/etc/bacula/scripts/webhooks/Aidan-Bacula-Mail.md", "Test")
|
||||
|
||||
for message_part in bathook.get_formatted_message(): # For every message part in the truncated output, run this loop
|
||||
webhook = DiscordWebhook(url=webhookURL, username="Test Embedded bot!") # Attach the message
|
||||
webhook.add_embed(bathook.get_discord_embed())
|
||||
response = webhook.execute() # Hit send
|
||||
16
scripts/webhooks/Robotics-Bacula-Webhook.py
Normal file
16
scripts/webhooks/Robotics-Bacula-Webhook.py
Normal file
@@ -0,0 +1,16 @@
|
||||
from discord_webhook import DiscordWebhook
|
||||
from bathook import bathook
|
||||
|
||||
webhookURL = "https://discordapp.com/api/webhooks/740630755259973713/CNhxPBJ4C6UZ-m1DVXUQ54KeJQD3I9Di0sAwldmyjw-s7dMPUWplq7rhGXegpWGtKSve"
|
||||
maxCharPerMessage = 1994
|
||||
|
||||
bathook = bathook("/etc/bacula/scripts/webhooks/RoboticsMail.md", "1721's google drive")
|
||||
|
||||
for message_part in bathook.get_formatted_message(): # For every message part in the truncated output, run this loop
|
||||
#message_part = "```" + message_part + "```" # Encapsulate the messsage
|
||||
#print(message_part)
|
||||
#webhook = DiscordWebhook(url=webhookURL, content=message_part) # Attach the message
|
||||
#response = webhook.execute() # Hit send
|
||||
webhook = DiscordWebhook(url=webhookURL, username="Tidal Force Tape Backup Daemon") # Attach the message
|
||||
webhook.add_embed(bathook.get_discord_embed())
|
||||
response = webhook.execute() # Hit send
|
||||
52
scripts/webhooks/RoboticsMail.md
Normal file
52
scripts/webhooks/RoboticsMail.md
Normal file
@@ -0,0 +1,52 @@
|
||||
01-Nov 13:20 bacula-dir JobId 538: Start Backup JobId 538, Job=Backup-Robotics.2020-11-01_02.15.01_35
|
||||
01-Nov 13:20 bacula-dir JobId 538: Using Device "Drive-0-LTO-3" to write.
|
||||
01-Nov 13:20 bacula-iron-sd JobId 538: Spooling data ...
|
||||
01-Nov 13:29 bacula-iron-sd JobId 538: User specified Job spool size reached: JobSpoolSize=16,106,158,076 MaxJobSpoolSize=16,106,127,360
|
||||
01-Nov 13:29 bacula-iron-sd JobId 538: Writing spooled data to Volume. Despooling 16,106,158,076 bytes ...
|
||||
01-Nov 13:35 bacula-iron-sd JobId 538: Despooling elapsed time = 00:05:38, Transfer rate = 47.65 M Bytes/second
|
||||
01-Nov 13:35 bacula-iron-sd JobId 538: Spooling data again ...
|
||||
01-Nov 13:41 bacula-iron-sd JobId 538: Committing spooled data to Volume "A02152". Despooling 14,365,535,210 bytes ...
|
||||
01-Nov 13:46 bacula-iron-sd JobId 538: Despooling elapsed time = 00:04:41, Transfer rate = 51.12 M Bytes/second
|
||||
01-Nov 13:46 bacula-iron-sd JobId 538: Elapsed time=00:25:59, Transfer rate=19.52 M Bytes/second
|
||||
01-Nov 13:46 bacula-iron-sd JobId 538: Sending spooled attrs to the Director. Despooling 1,689,693 bytes ...
|
||||
01-Nov 13:46 bacula-dir JobId 538: Bacula bacula-dir 9.4.2 (04Feb19):
|
||||
Build OS: x86_64-pc-linux-gnu ubuntu 20.04
|
||||
JobId: 538
|
||||
Job: Backup-Robotics.2020-11-01_02.15.01_35
|
||||
Backup Level: Differential, since=2020-10-05 03:54:39
|
||||
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: "Diff-Pool" (From Job DiffPool override)
|
||||
Catalog: "MyCatalog" (From Client resource)
|
||||
Storage: "Iron-Autochanger" (From Pool resource)
|
||||
Scheduled time: 01-Nov-2020 02:15:01
|
||||
Start time: 01-Nov-2020 13:20:43
|
||||
End time: 01-Nov-2020 13:46:44
|
||||
Elapsed time: 26 mins 1 sec
|
||||
Priority: 10
|
||||
FD Files Written: 5,930
|
||||
SD Files Written: 5,930
|
||||
FD Bytes Written: 30,442,166,309 (30.44 GB)
|
||||
SD Bytes Written: 30,443,217,714 (30.44 GB)
|
||||
Rate: 19501.7 KB/s
|
||||
Software Compression: None
|
||||
Comm Line Compression: None
|
||||
Snapshot/VSS: no
|
||||
Encryption: no
|
||||
Accurate: no
|
||||
Volume name(s): A02152
|
||||
Volume Session Id: 92
|
||||
Volume Session Time: 1601284581
|
||||
Last Volume Bytes: 161,025,371,136 (161.0 GB)
|
||||
Non-fatal FD errors: 0
|
||||
SD Errors: 0
|
||||
FD termination status: OK
|
||||
SD termination status: OK
|
||||
Termination: Backup OK
|
||||
|
||||
01-Nov 13:46 bacula-dir JobId 538: Begin pruning Jobs older than 30 years .
|
||||
01-Nov 13:46 bacula-dir JobId 538: No Jobs found to prune.
|
||||
01-Nov 13:46 bacula-dir JobId 538: Begin pruning Files.
|
||||
01-Nov 13:46 bacula-dir JobId 538: No Files found to prune.
|
||||
01-Nov 13:46 bacula-dir JobId 538: End auto prune.
|
||||
|
||||
BIN
scripts/webhooks/__pycache__/bathook.cpython-38.pyc
Normal file
BIN
scripts/webhooks/__pycache__/bathook.cpython-38.pyc
Normal file
Binary file not shown.
BIN
scripts/webhooks/__pycache__/mextract.cpython-38.pyc
Normal file
BIN
scripts/webhooks/__pycache__/mextract.cpython-38.pyc
Normal file
Binary file not shown.
74
scripts/webhooks/bathook.py
Normal file
74
scripts/webhooks/bathook.py
Normal file
@@ -0,0 +1,74 @@
|
||||
from discord_webhook import DiscordEmbed
|
||||
import re
|
||||
|
||||
|
||||
class bathook:
|
||||
def __init__(self, path_to_report, data_from):
|
||||
with open (path_to_report, "r") as messagesfile: # Open the file
|
||||
self.raw_messages = messagesfile.read() # Extract the data
|
||||
|
||||
if "Rescheduled" in self.raw_messages: # If the job was rescheduled
|
||||
self.raw_messages = self.raw_messages.split("Rescheduled", 1)[-1] # Remove the failed data
|
||||
self.rescheduled = "\nJob was rescheduled at least once." # We rescheduled
|
||||
else:
|
||||
self.rescheduled = "" # We did not reschedule
|
||||
|
||||
self.endtime = self.mextract(self.raw_messages, "End time:")
|
||||
self.elapsedtime = self.mextract(self.raw_messages, "Elapsed time:")
|
||||
self.byteswritten = self.mextract(self.raw_messages, "SD Bytes Written:")
|
||||
self.usedvolumes = self.mextract(self.raw_messages, "Volume name\(s\):")
|
||||
self.jobname = self.mextract(self.raw_messages, "Job:")
|
||||
self.jobid = self.mextract(self.raw_messages, "JobId:")
|
||||
self.level = self.mextract(self.raw_messages, "Backup Level:")
|
||||
self.data_from = data_from
|
||||
|
||||
if "Backup OK" in self.raw_messages and "Backup OK -- with warnings" not in self.raw_messages:
|
||||
self.backupstatus = "OK"
|
||||
else:
|
||||
self.backupstatus = "Error or warnings."
|
||||
|
||||
self.maxCharPerMessage = 1994
|
||||
|
||||
def mextract(self, report, variable):
|
||||
try:
|
||||
result = re.search(variable + '(.*)', report)
|
||||
print(result)
|
||||
return(result.group(1).lstrip()) # lstrip removes leading spaces.
|
||||
except:
|
||||
return("[Variable Not found]")
|
||||
|
||||
def get_formatted_message(self):
|
||||
if "Backup OK" in self.raw_messages and "Backup OK -- with warnings" not in self.raw_messages:
|
||||
truncated_stdout = ["""Job {0} (Job {1}) completed with status Backup OK, omitting full report.
|
||||
All data from {2} was successfully written to tape on {3}. Backup level was {4}.
|
||||
Backup took {5} And used {6} bytes.""".format(self.jobname, self.jobid, self.data_from, self.endtime, self.level, self.elapsedtime, self.byteswritten)]
|
||||
if len(self.usedvolumes) > 1:
|
||||
truncated_stdout[0] = truncated_stdout[0] + ("\nWrote data to volume(s) {0} {1}".format(self.usedvolumes, self.rescheduled))
|
||||
else:
|
||||
# Discord limits each message to 2000 chars, if the message is longer than that, truncate it
|
||||
truncated_stdout = [self.raw_messages[i:i+self.maxCharPerMessage] for i in range(0, len(self.raw_messages), self.maxCharPerMessage)]
|
||||
return(truncated_stdout)
|
||||
|
||||
def get_discord_embed(self):
|
||||
if self.backupstatus == "OK":
|
||||
headercolor = 3388189
|
||||
headerdesc = "The most recent backup completed with status OK, and so the full report will not be shown."
|
||||
else:
|
||||
headercolor = 10358814
|
||||
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="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)
|
||||
self.embed.add_embed_field(name="Bytes Written", value=self.byteswritten)
|
||||
if len(self.usedvolumes) > 0:
|
||||
self.embed.add_embed_field(name="Used Volumes", value=self.usedvolumes)
|
||||
self.embed.add_embed_field(name="Job Name", value=self.jobname)
|
||||
self.embed.add_embed_field(name="Job ID", value=self.jobid)
|
||||
self.embed.add_embed_field(name="Job Level", value=self.level)
|
||||
if len(self.rescheduled) > 0:
|
||||
self.embed.add_embed_field(name="Job Reschedule?", value=self.rescheduled)
|
||||
|
||||
return(self.embed)
|
||||
10
scripts/webhooks/mextract.py
Normal file
10
scripts/webhooks/mextract.py
Normal file
@@ -0,0 +1,10 @@
|
||||
import re
|
||||
|
||||
|
||||
def mextract(report, variable):
|
||||
try:
|
||||
result = re.search(variable + '(.*)', report)
|
||||
print(result)
|
||||
return(result.group(1).lstrip()) # lstrip removes leading spaces.
|
||||
except:
|
||||
return("[Variable Not found]")
|
||||
Reference in New Issue
Block a user