Compare commits

..

9 Commits

Author SHA1 Message Date
5b24664f46 build 2025-08-02 18:01:16 +02:00
0bf0aef1e2 build 2025-08-02 18:00:37 +02:00
c93a32a79f build 2025-08-02 17:00:21 +02:00
c0213d97e1 build 2025-08-02 16:25:16 +02:00
edde137ae6 build 2025-08-02 16:24:25 +02:00
e476237ec2 build 2025-08-02 16:23:40 +02:00
0ffd2adf64 build 2025-08-02 16:23:18 +02:00
ac0089f205 build 2025-08-02 16:17:12 +02:00
81ffc7a72b build 2025-08-02 16:16:50 +02:00

View File

@@ -20,7 +20,7 @@ import paramiko
file_path = os.path.realpath(__file__) file_path = os.path.realpath(__file__)
dir_path = os.path.dirname(file_path) dir_path = os.path.dirname(file_path)
VERSION="1.0.8" VERSION="1.0.9"
# print(file_path) # print(file_path)
# print(dir_path) # print(dir_path)
os.chdir(dir_path) os.chdir(dir_path)
@@ -239,7 +239,7 @@ if _RESTORE:
step = 100 / len(_APP) step = 100 / len(_APP)
for app in _APP: for app in _APP:
#msg = {"mode":_MODE, "status":"restore","bak_name":"Restore","host":host,"cur_job":app,"start_time":STARTTIME,"end_time":"","progress":str(round(np.ceil(PROGRESS))) + "%","finished":1,"used_space":1} #msg = {"mode":_MODE, "status":"restore","bak_name":"Restore","host":host,"cur_job":app,"start_time":STARTTIME,"end_time":"","progress":str(round(np.ceil(PROGRESS))) + "%","finished":1,"used_space":1}
msg = {"mode":_MODE, "status":"restore","bak_name":"Restore","host":host,"cur_job":app,"start_time":STARTTIME,"end_time":"","progress":"0" + "%","finished":1,"used_space":1} msg = {"mode":_MODE, "status":"restore","bak_name":"Restore","host":host,"cur_job":app,"start_time":STARTTIME,"end_time":"","progress":str(round(PROGRESS,0)) + "%","finished":1,"used_space":1}
logging.info(msg) logging.info(msg)
@@ -472,9 +472,13 @@ if _BACKUP:
finished = [] finished = []
now = datetime.datetime.now() now = datetime.datetime.now()
STARTTIME = now.strftime("%Y-%m-%d_%H:%M:%S") STARTTIME = now.strftime("%Y-%m-%d_%H:%M:%S")
topic = "sectorq/amd/restore"
msg = {"mode":"restore", "status":"restore","bak_name":"s","host":0,"cur_job":"aaa","start_time":1,"end_time":1,"progress":0,"finished":0,"used_space":0}
send_mqtt_message(msg)
topic = "sectorq/amd/backups" topic = "sectorq/amd/backups"
msg = {"mode":_MODE, "status":"started","bak_name":"complete","host":"","cur_job":"","start_time":STARTTIME,"end_time":"in progress","progress":0,"finished":",".join(finished)} msg = {"mode":_MODE, "status":"started","bak_name":"complete","host":"","cur_job":"","start_time":STARTTIME,"end_time":"in progress","progress":0,"finished":",".join(finished)}
send_mqtt_message(msg) send_mqtt_message(msg)
# iterate over files in # iterate over files in
# that directory # that directory
@@ -647,7 +651,7 @@ if _BACKUP:
continue continue
elif s == "nas.home.lan": elif s == "nas.home.lan":
user = "admin" user = "admin"
cmnd = "/share/Data/__GITLAB/omv_backup/venv/bin/python3 /share/Data/__GITLAB/omv_backup/omv_backup.py -r all" cmnd = "/share/Data/python/bin/python3 /share/Data/__GITLAB/omv_backup/omv_backup.py -r all"
else: else:
user = "jd" user = "jd"
cmnd = "sudo /myapps/omv_backup.py -r all" cmnd = "sudo /myapps/omv_backup.py -r all"