Fixed taging for disabled host

This commit is contained in:
ladislav.dusa
2025-04-09 14:44:28 +02:00
parent f9ae8bc1f9
commit e1ee9febac

View File

@ -239,11 +239,15 @@ if _RESTORE:
PROGRESS = 0
topic = "sectorq/amd/backups"
step = 100 / len(_APP)
for app in _APP:
topic = "sectorq/amd/restore/{}".format(app)
msg = {"status":"inactive","bak_name":app,"start_time":"inactive","end_time":"inactive","progress":0}
msg = {"mode":_MODE, "status":"restore","bak_name":"s","host":s,"cur_job":app,"start_time":STARTTIME,"end_time":"","progress":PROGRESS,"finished":1,"used_space":1}
logging.info(msg)
send_mqtt_message(msg)
PROGRESS = PROGRESS + step
now = datetime.datetime.now()
DATETIME = now.strftime("%Y-%m-%d_%H-%M-%S")
BACKUP_HOST = f"root@amd.home.lan"
@ -280,9 +284,6 @@ if _RESTORE:
FULL_BACKUP_LATEST = f"{NEW_BACKUP_DIR}/{_DATE}"
LATEST_LINK = f"/{host}/{app}/{_DATE}"
msg = {"status":"started","bak_name":app,"start_time":DATETIME,"end_time":"in progress", "progress":0}
send_mqtt_message(msg)
logging.info("Create backup dir")
logging.info(cmnd)