mirror of
https://gitlab.sectorq.eu/jaydee/omv_backup.git
synced 2025-09-13 20:20:11 +02:00
Compare commits
9 Commits
9ef0cc9dac
...
5b24664f46
Author | SHA1 | Date | |
---|---|---|---|
5b24664f46 | |||
0bf0aef1e2 | |||
c93a32a79f | |||
c0213d97e1 | |||
edde137ae6 | |||
e476237ec2 | |||
0ffd2adf64 | |||
ac0089f205 | |||
81ffc7a72b |
@@ -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"
|
||||||
|
Reference in New Issue
Block a user