feat: add oneshot systemd service for scheduled backup check
This commit is contained in:
@@ -0,0 +1,25 @@
|
|||||||
|
# ns8-backup-monitor-check.service
|
||||||
|
#
|
||||||
|
# One-shot systemd service that runs the scheduled backup recap check.
|
||||||
|
# Invoked by ns8-backup-monitor-check.timer — not managed directly.
|
||||||
|
#
|
||||||
|
# This service reads backup status from the NS8 cluster Redis, classifies
|
||||||
|
# the outcome (SUCCESS / PARTIAL / REPO_FAILURE), and sends a recap email
|
||||||
|
# via ns8-sendmail. It is the scheduled counterpart to the Alertmanager
|
||||||
|
# webhook path, which only fires on failures.
|
||||||
|
[Unit]
|
||||||
|
Description=ns8-backup-monitor scheduled backup status check
|
||||||
|
After=network.target ns8-backup-monitor.service
|
||||||
|
# Do not block startup if the main service is not running
|
||||||
|
Wants=ns8-backup-monitor.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
# Run as root to access the NS8 Redis socket and ns8-sendmail
|
||||||
|
User=root
|
||||||
|
ExecStart=/usr/bin/python3 -m ns8_backup_monitor.scheduled_check
|
||||||
|
WorkingDirectory=/opt/ns8-backup-monitor
|
||||||
|
# Capture stdout and stderr to the journal
|
||||||
|
StandardOutput=journal
|
||||||
|
StandardError=journal
|
||||||
|
SyslogIdentifier=ns8-backup-monitor-check
|
||||||
Reference in New Issue
Block a user