diff --git a/Dir Config/LibraryFrame.png b/Dir Config/LibraryFrame.png deleted file mode 100644 index 9d446ec..0000000 Binary files a/Dir Config/LibraryFrame.png and /dev/null differ diff --git a/Dir Config/clients/zinc-client-system.conf b/Dir Config/clients/zinc-client-system.conf index 56d8d72..1718972 100644 --- a/Dir Config/clients/zinc-client-system.conf +++ b/Dir Config/clients/zinc-client-system.conf @@ -1 +1,17 @@ -# These are jobs run for vms, storage, etc \ No newline at end of file +# These are jobs run for vms, storage, etc + +Job { # Backup Proxmox VZdumps + Name = "Backup-Proxmox" + Client = Zinc-Client + Type = "Backup" + FileSet = "Proxmox Backups" + Storage = Iron-Autochanger + #Schedule = EveryTwoDays + Messages = JoesMail + + Pool = Full-Pool # required parameter for all Jobs, despite what appears in the next few lines + + Full Backup Pool = Full-Pool + Differential Backup Pool = Diff-Pool + Incremental Backup Pool = Incr-Pool +} diff --git a/Dir Config/filesets/filesets-system.conf b/Dir Config/filesets/filesets-system.conf index 8cd5bf1..175f12a 100644 --- a/Dir Config/filesets/filesets-system.conf +++ b/Dir Config/filesets/filesets-system.conf @@ -25,7 +25,7 @@ FileSet { # Backup proxmox backups FileSet { - Name = "ProxmoxBackups" + Name = "Proxmox Backups" Include { Options { signature = MD5 diff --git a/Dir Config/schedules.conf b/Dir Config/schedules.conf index e5ce6fa..1eba563 100644 --- a/Dir Config/schedules.conf +++ b/Dir Config/schedules.conf @@ -1,37 +1,44 @@ Schedule { Name = EveryTwoDays - Run = Level=Full jan 1st sun at 2:15 - Run = Level=Differential feb 1st sun at 2:15 - Run = Level=Differential mar 1st sun at 2:15 - Run = Level=Full apr 1st sun at 2:15 - Run = Level=Differential may 1st sun at 2:15 - Run = Level=Differential jun 1st sun at 2:15 - Run = Level=Full jul 1st sun at 2:15 - Run = Level=Differential aug 1st sun at 2:15 - Run = Level=Differential sep 1st sun at 2:15 - Run = Level=Full oct 1st sun at 2:15 - Run = Level=Differential nov 1st sun at 2:15 - Run = Level=Differential dec 1st sun at 2:15 + Run = Level=Full jan apr jul oct 1st sun at 2:15 # Run a full backup once every four months + Run = Level=Differential feb mar may jun aug sep nov dec 1st sun at 2:15 # Run a differential backup every other month - #Run = Level=Incremental tue at 2:15 - Run = Level=Incremental sat at 2:15 + Run = Level=Incremental sat tue at 2:15 # Run an incremental backup on tuesdays and saturdays + + #Run = Level=Differential mar 1st sun at 2:15 + #Run = Level=Full apr 1st sun at 2:15 + #Run = Level=Differential may 1st sun at 2:15 + #Run = Level=Differential jun 1st sun at 2:15 + #Run = Level=Full jul 1st sun at 2:15 + #Run = Level=Differential aug 1st sun at 2:15 + #Run = Level=Differential sep 1st sun at 2:15 + #Run = Level=Full oct 1st sun at 2:15 + #Run = Level=Differential nov 1st sun at 2:15 + #Run = Level=Differential dec 1st sun at 2:15 + + #Run = Level=Incremental tue thu at 2:15 + #Run = Level=Incremental sat tue at 2:15 } Schedule { Name = AdminTwoDays - Run = Level=Full jan 1st sun at 2:30 - Run = Level=Differential feb 1st sun at 2:30 - Run = Level=Differential mar 1st sun at 2:30 - Run = Level=Full apr 1st sun at 2:30 - Run = Level=Differential may 1st sun at 2:30 - Run = Level=Differential jun 1st sun at 2:30 - Run = Level=Full jul 1st sun at 2:30 - Run = Level=Differential aug 1st sun at 2:30 - Run = Level=Differential sep 1st sun at 2:30 - Run = Level=Full oct 1st sun at 2:30 - Run = Level=Differential nov 1st sun at 2:30 - Run = Level=Differential dec 1st sun at 2:30 + Run = Level=Full jan apr jul oct 1st sun at 2:30 + Run = Level=Differential feb mar may jun aug sep nov dec 1st sun at 2:30 - #Run = Level=Incremental tue at 2:30 - Run = Level=Incremental sat at 2:30 + Run = Level=Incremental sat tue at 2:30 + + #Run = Level=Full jan 1st sun at 2:30 + #Run = Level=Differential feb 1st sun at 2:30 + #Run = Level=Differential mar 1st sun at 2:30 + #Run = Level=Full apr 1st sun at 2:30 + #Run = Level=Differential may 1st sun at 2:30 + #Run = Level=Differential jun 1st sun at 2:30 + #Run = Level=Full jul 1st sun at 2:30 + #Run = Level=Differential aug 1st sun at 2:30 + #Run = Level=Differential sep 1st sun at 2:30 + #Run = Level=Full oct 1st sun at 2:30 + #Run = Level=Differential nov 1st sun at 2:30 + #Run = Level=Differential dec 1st sun at 2:30 + + #Run = Level=Incremental sat tue at 2:30 } diff --git a/Dir Config/scripts/LibraryFrame.png b/Dir Config/scripts/LibraryFrame.png new file mode 100644 index 0000000..37c4418 Binary files /dev/null and b/Dir Config/scripts/LibraryFrame.png differ diff --git a/Dir Config/scripts/bacula_discord_webhook.py b/Dir Config/scripts/bacula_discord_webhook.py index 7fa62d1..7a5cdc4 100644 --- a/Dir Config/scripts/bacula_discord_webhook.py +++ b/Dir Config/scripts/bacula_discord_webhook.py @@ -1,5 +1,5 @@ -from discord_webhook import DiscordWebhook -import subprocess +from discord_webhook import DiscordWebhook, DiscordEmbed +import subprocess, vlc, cv2 cameraURL = "rtsp://10.85.3.33:554/11" webhookURL = "https://discordapp.com/api/webhooks/719690867811811348/8LExCQbqOPP0XAdNcbV8JHrVYupOSYmeLwkBJWCDCe72JoPyc4Yy_R2wzbkKSN33MPAn" @@ -23,9 +23,19 @@ truncated_stdout = [cleaned_stdout[i:i+maxCharPerMessage] for i in range(0, len( print (truncated_stdout) # Print the truncated message if (truncated_stdout[0] != b'You have no messages.\n'): # If the first part of the truncated message is empty (no messages) dont send it. + vidcap = cv2.VideoCapture("rtsp://10.85.3.33:554/11") + success,image = vidcap.read() + print(success) + if success: + cv2.imwrite("LibraryFrame.png", image) + imagewebhook = DiscordWebhook(url=webhookURL, content="Live Snapshot") + with open("LibraryFrame.png", "rb") as f: + imagewebhook.add_file(file=f.read(), filename='LibraryFrame.png') + response = imagewebhook.execute() + for message_part in truncated_stdout: # For every message part in the truncated output, run this loop message_part = b"```" + message_part + b"```" - webhook = DiscordWebhook(url=webhookURL, content=message_part) # Send the output to the webhook URL + webhook = DiscordWebhook(url=webhookURL, content=message_part) # Send the output to the webhook URL response = webhook.execute() else: print("Done.") diff --git a/Dir Config/scripts/test-video.py b/Dir Config/scripts/test-video.py new file mode 100644 index 0000000..4cba429 --- /dev/null +++ b/Dir Config/scripts/test-video.py @@ -0,0 +1,16 @@ +from discord_webhook import DiscordWebhook, DiscordEmbed +webhookURL = "https://discordapp.com/api/webhooks/719690867811811348/8LExCQbqOPP0XAdNcbV8JHrVYupOSYmeLwkBJWCDCe72JoPyc4Yy_R2wzbkKSN33MPAn" + +import cv2 +vidcap = cv2.VideoCapture("rtsp://10.85.3.33:554/11") +success,image = vidcap.read() +if success: + cv2.imwrite("LibraryFrame.png", image) + +webhook = DiscordWebhook(url=webhookURL, content="This a test") # Send the output to the webhook URL + +with open("LibraryFrame.png", "rb") as f: + webhook.add_file(file=f.read(), filename='LibraryFrame.png') + + +response = webhook.execute() diff --git a/Dir Config/scripts/test.md b/Dir Config/scripts/test.md index b0a67dc..a453f14 100644 --- a/Dir Config/scripts/test.md +++ b/Dir Config/scripts/test.md @@ -2,43 +2,6 @@ Connecting to Director 10.85.3.30:9101 1000 OK: 103 bacula-dir Version: 9.4.2 (04 February 2019) Enter a period to cancel a command. messages -07-Jun 11:15 bacula-dir JobId 97: No prior Full backup Job record found. -07-Jun 11:15 bacula-dir JobId 97: No prior or suitable Full backup found in catalog. Doing FULL backup. -07-Jun 11:15 bacula-dir JobId 97: Start Backup JobId 97, Job=Backup-Mark.2020-06-07_11.15.04_52 -07-Jun 11:15 bacula-dir JobId 97: Using Device "Drive-0-LTO-3" to write. -07-Jun 11:15 temp-iron-sd JobId 97: 3304 Issuing autochanger "load Volume A00572, Slot 17, Drive 0" command. -07-Jun 11:15 temp-iron-sd JobId 97: 3305 Autochanger "load Volume A00572, Slot 17, Drive 0", status is OK. -07-Jun 11:15 temp-iron-sd JobId 97: Volume "A00572" previously written, moving to end of data. -07-Jun 11:17 temp-iron-sd JobId 97: Warning: For Volume "A00572": -The number of files mismatch! Volume=37 Catalog=36 -Correcting Catalog -07-Jun 14:14 temp-iron-sd JobId 97: [SI0202] End of Volume "A00572" at 105:58664 on device "Drive-0-LTO-3" (/dev/nst0). Write of 64512 bytes got -1. -07-Jun 14:14 temp-iron-sd JobId 97: Re-read of last block succeeded. -07-Jun 14:14 temp-iron-sd JobId 97: End of medium on Volume "A00572" Bytes=419,778,035,712 Blocks=4,274,868 at 07-Jun-2020 18:14. -07-Jun 14:14 temp-iron-sd JobId 97: 3307 Issuing autochanger "unload Volume A00572, Slot 17, Drive 0" command. -07-Jun 14:15 bacula-dir JobId 97: Using Volume "A02057" from 'Scratch' pool. -07-Jun 14:15 temp-iron-sd JobId 97: 3304 Issuing autochanger "load Volume A02057, Slot 15, Drive 0" command. -07-Jun 14:16 temp-iron-sd JobId 97: 3305 Autochanger "load Volume A02057, Slot 15, Drive 0", status is OK. -07-Jun 14:16 temp-iron-sd JobId 97: Wrote label to prelabeled Volume "A02057" on Tape device "Drive-0-LTO-3" (/dev/nst0) -07-Jun 14:16 temp-iron-sd JobId 97: New volume "A02057" mounted on device "Drive-0-LTO-3" (/dev/nst0) at 07-Jun-2020 18:16. -07-Jun 18:42 temp-iron-sd JobId 97: [SI0202] End of Volume "A02057" at 104:54117 on device "Drive-0-LTO-3" (/dev/nst0). Write of 64512 bytes got -1. -07-Jun 18:42 temp-iron-sd JobId 97: Re-read of last block succeeded. -07-Jun 18:42 temp-iron-sd JobId 97: End of medium on Volume "A02057" Bytes=419,484,699,648 Blocks=6,502,428 at 07-Jun-2020 22:42. -07-Jun 18:42 temp-iron-sd JobId 97: 3307 Issuing autochanger "unload Volume A02057, Slot 15, Drive 0" command. -07-Jun 18:43 bacula-dir JobId 97: Using Volume "A01099" from 'Scratch' pool. -07-Jun 18:43 temp-iron-sd JobId 97: 3304 Issuing autochanger "load Volume A01099, Slot 4, Drive 0" command. -07-Jun 18:44 temp-iron-sd JobId 97: 3305 Autochanger "load Volume A01099, Slot 4, Drive 0", status is OK. -07-Jun 18:44 temp-iron-sd JobId 97: Wrote label to prelabeled Volume "A01099" on Tape device "Drive-0-LTO-3" (/dev/nst0) -07-Jun 18:44 temp-iron-sd JobId 97: New volume "A01099" mounted on device "Drive-0-LTO-3" (/dev/nst0) at 07-Jun-2020 22:44. -07-Jun 23:35 temp-iron-sd JobId 97: [SI0202] End of Volume "A01099" at 105:44015 on device "Drive-0-LTO-3" (/dev/nst0). Write of 64512 bytes got -1. -07-Jun 23:35 temp-iron-sd JobId 97: Re-read of last block succeeded. -07-Jun 23:35 temp-iron-sd JobId 97: End of medium on Volume "A01099" Bytes=422,832,936,960 Blocks=6,554,329 at 08-Jun-2020 03:35. -07-Jun 23:35 temp-iron-sd JobId 97: 3307 Issuing autochanger "unload Volume A01099, Slot 4, Drive 0" command. -07-Jun 23:36 bacula-dir JobId 97: Using Volume "A02218" from 'Scratch' pool. -07-Jun 23:37 temp-iron-sd JobId 97: 3304 Issuing autochanger "load Volume A02218, Slot 3, Drive 0" command. -07-Jun 23:37 temp-iron-sd JobId 97: 3305 Autochanger "load Volume A02218, Slot 3, Drive 0", status is OK. -07-Jun 23:37 temp-iron-sd JobId 97: Wrote label to prelabeled Volume "A02218" on Tape device "Drive-0-LTO-3" (/dev/nst0) -07-Jun 23:37 temp-iron-sd JobId 97: New volume "A02218" mounted on device "Drive-0-LTO-3" (/dev/nst0) at 08-Jun-2020 03:37. 08-Jun 03:48 temp-iron-sd JobId 97: Elapsed time=16:25:53, Transfer rate=24.92 M Bytes/second 08-Jun 03:48 temp-iron-sd JobId 97: Sending spooled attrs to the Director. Despooling 13,762,121 bytes ... 08-Jun 03:48 bacula-dir JobId 97: Bacula bacula-dir 9.4.2 (04Feb19): @@ -74,10 +37,4 @@ Correcting Catalog SD Errors: 0 FD termination status: OK SD termination status: OK - Termination: Backup OK - -08-Jun 03:48 bacula-dir JobId 97: Begin pruning Jobs older than 30 years . -08-Jun 03:48 bacula-dir JobId 97: No Jobs found to prune. -08-Jun 03:48 bacula-dir JobId 97: Begin pruning Files. -08-Jun 03:48 bacula-dir JobId 97: No Files found to prune. -08-Jun 03:48 bacula-dir JobId 97: End auto prune. + Termination: Backup OK \ No newline at end of file