feat: Enhance webhook notification system to include default URL and filtering tags

This commit is contained in:
Peter Wood
2025-05-26 09:36:16 -04:00
parent b994508774
commit b33f6b8e5b

View File

@@ -50,7 +50,9 @@ The script supports multiple notification channels:
./backup-plex.sh --webhook=https://your-webhook-url.com/endpoint
```
Sends JSON payloads with backup status, hostname, and timestamps.
**Default Webhook**: The script includes a default webhook URL (`https://notify.peterwood.rocks/lab`) that will be used if no custom webhook is specified. To use a different webhook, specify it with the `--webhook` option.
Sends JSON payloads with backup status, hostname, and timestamps. Notifications include tags for filtering (backup, plex, hostname, and status-specific tags like "errors" or "warnings").
#### Email Notifications
@@ -242,7 +244,9 @@ Only checks database integrity without performing backup.
./backup-plex.sh --non-interactive --auto-repair --webhook=https://notify.example.com/backup
```
Runs in automated mode with auto-repair and webhook notifications.
Runs in automated mode with auto-repair and custom webhook notifications.
**Note**: If no `--webhook` option is specified, the script will use the default webhook URL (`https://notify.peterwood.rocks/lab`) for notifications.
### Performance-Optimized Backup
@@ -262,10 +266,15 @@ For daily automated backups at 2 AM:
# Edit crontab
crontab -e
# Add this line for daily backup
# Add this line for daily backup with email notifications
0 2 * * * /home/acedanger/shell/backup-plex.sh --non-interactive --auto-repair --email=admin@example.com 2>&1 | logger -t plex-backup
# Or for daily backup with default webhook notifications (https://notify.peterwood.rocks/lab)
0 2 * * * /home/acedanger/shell/backup-plex.sh --non-interactive --auto-repair 2>&1 | logger -t plex-backup
```
**Note**: The script will automatically use the default webhook URL for notifications unless a custom webhook is specified with `--webhook=URL`.
### Systemd Service
Create a systemd service for more control: