Backup automatico script del 2026-08-09 07:00
This commit is contained in:
1 parent
7c2efce9df
commit
3a7b867e83
4 files changed
+55
-11
No files matched your search
@@ -1,17 +1,35 @@
|
|||||||
|
global_defs {
|
||||||
|
enable_script_security
|
||||||
|
script_user root
|
||||||
|
}
|
||||||
|
|
||||||
|
vrrp_script chk_ha {
|
||||||
|
script "/usr/local/sbin/keepalived-check-ha.sh"
|
||||||
|
interval 5
|
||||||
|
weight -30
|
||||||
|
fall 3
|
||||||
|
rise 2
|
||||||
|
user root
|
||||||
|
}
|
||||||
|
|
||||||
vrrp_instance VI_1 {
|
vrrp_instance VI_1 {
|
||||||
state MASTER
|
state BACKUP
|
||||||
interface eth0
|
interface eth0
|
||||||
virtual_router_id 51
|
virtual_router_id 51
|
||||||
priority 101 # 101 = Priorità più alta (Master)
|
priority 101
|
||||||
advert_int 1
|
advert_int 1
|
||||||
|
preempt_delay 30
|
||||||
authentication {
|
authentication {
|
||||||
auth_type PASS
|
auth_type PASS
|
||||||
auth_pass @Dedelove1
|
auth_pass @Dedelove1
|
||||||
}
|
}
|
||||||
virtual_ipaddress {
|
virtual_ipaddress {
|
||||||
192.168.128.85 # Il nostro VIP
|
192.168.128.85
|
||||||
}
|
}
|
||||||
notify_master "/home/daniely/rete/scripts/ha-failover.sh assume-tier-a"
|
track_script {
|
||||||
notify_backup "/home/daniely/rete/scripts/ha-failover.sh release-tier-a"
|
chk_ha
|
||||||
notify_fault "/home/daniely/rete/scripts/ha-failover.sh fault"
|
}
|
||||||
|
notify_master "/usr/local/sbin/keepalived-notify-master.sh"
|
||||||
|
notify_backup "/usr/local/sbin/keepalived-notify-backup.sh"
|
||||||
|
notify_fault "/usr/local/sbin/keepalived-notify-fault.sh"
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,24 @@
|
|||||||
|
global_defs {
|
||||||
|
enable_script_security
|
||||||
|
script_user root
|
||||||
|
}
|
||||||
|
|
||||||
|
vrrp_script chk_ha {
|
||||||
|
script "/usr/local/sbin/keepalived-check-ha.sh"
|
||||||
|
interval 5
|
||||||
|
weight -30
|
||||||
|
fall 3
|
||||||
|
rise 2
|
||||||
|
user root
|
||||||
|
}
|
||||||
|
|
||||||
vrrp_instance VI_1 {
|
vrrp_instance VI_1 {
|
||||||
state BACKUP
|
state BACKUP
|
||||||
interface eth0
|
interface eth0
|
||||||
virtual_router_id 51
|
virtual_router_id 51
|
||||||
priority 100 # 100 = Priorità più bassa (Backup)
|
priority 100
|
||||||
advert_int 1
|
advert_int 1
|
||||||
|
preempt_delay 30
|
||||||
authentication {
|
authentication {
|
||||||
auth_type PASS
|
auth_type PASS
|
||||||
auth_pass @Dedelove1
|
auth_pass @Dedelove1
|
||||||
@@ -11,7 +26,10 @@ vrrp_instance VI_1 {
|
|||||||
virtual_ipaddress {
|
virtual_ipaddress {
|
||||||
192.168.128.85
|
192.168.128.85
|
||||||
}
|
}
|
||||||
notify_master "/home/daniely/rete/scripts/ha-failover.sh assume-tier-a"
|
track_script {
|
||||||
notify_backup "/home/daniely/rete/scripts/ha-failover.sh release-tier-a"
|
chk_ha
|
||||||
notify_fault "/home/daniely/rete/scripts/ha-failover.sh fault"
|
}
|
||||||
|
notify_master "/usr/local/sbin/keepalived-notify-master.sh"
|
||||||
|
notify_backup "/usr/local/sbin/keepalived-notify-backup.sh"
|
||||||
|
notify_fault "/usr/local/sbin/keepalived-notify-fault.sh"
|
||||||
}
|
}
|
||||||
@@ -440,7 +440,7 @@ fi
|
|||||||
# 3. EEPROM firmware
|
# 3. EEPROM firmware
|
||||||
audit_eeprom
|
audit_eeprom
|
||||||
|
|
||||||
# 4. Aggiornamento container Docker (Watchtower run-once, sostituisce il daemon schedulato)
|
# 4. Aggiornamento container Docker (Watchtower run-once; il daemon è MONITOR_ONLY)
|
||||||
run_watchtower
|
run_watchtower
|
||||||
|
|
||||||
# 5. Audit residui
|
# 5. Audit residui
|
||||||
|
|||||||
@@ -526,6 +526,14 @@ def main(chat_ids: Optional[List[str]] = None, debug_mode: bool = False):
|
|||||||
LOGGER.info("[DEBUG MODE] Bypass anti-spam: invio forzato")
|
LOGGER.info("[DEBUG MODE] Bypass anti-spam: invio forzato")
|
||||||
elif sig == last_sig:
|
elif sig == last_sig:
|
||||||
LOGGER.info("Allerta già notificata e invariata. Nessuna nuova notifica.")
|
LOGGER.info("Allerta già notificata e invariata. Nessuna nuova notifica.")
|
||||||
|
# Aggiorna solo la data di calendario così Casa non tratta il bollettino
|
||||||
|
# come «di ieri» mentre le allerte regionali valgono ancora per oggi.
|
||||||
|
today = today_str_italy()
|
||||||
|
if state.get("date") != today:
|
||||||
|
state = dict(state)
|
||||||
|
state["date"] = today
|
||||||
|
save_state(state)
|
||||||
|
LOGGER.info("Stato DPC: date aggiornata a %s (firma invariata).", today)
|
||||||
return
|
return
|
||||||
|
|
||||||
# A questo punto: ci sono allerte e sono nuove -> prova invio
|
# A questo punto: ci sono allerte e sono nuove -> prova invio
|
||||||
|
|||||||
Reference in new issue
Block a user