mirror of
https://github.com/acedanger/shell.git
synced 2025-12-06 06:40:13 -08:00
feat: Enhance webhook notification system to include default URL and filtering tags
This commit is contained in:
@@ -50,7 +50,9 @@ The script supports multiple notification channels:
|
|||||||
./backup-plex.sh --webhook=https://your-webhook-url.com/endpoint
|
./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
|
#### 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
|
./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
|
### Performance-Optimized Backup
|
||||||
|
|
||||||
@@ -262,10 +266,15 @@ For daily automated backups at 2 AM:
|
|||||||
# Edit crontab
|
# Edit crontab
|
||||||
crontab -e
|
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
|
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
|
### Systemd Service
|
||||||
|
|
||||||
Create a systemd service for more control:
|
Create a systemd service for more control:
|
||||||
|
|||||||
Reference in New Issue
Block a user