mirror of
https://gitlab.sectorq.eu/jaydee/omv_backup.git
synced 2025-09-13 20:20:11 +02:00
Compare commits
7 Commits
298c9aee23
...
99f673996e
Author | SHA1 | Date | |
---|---|---|---|
99f673996e | |||
68e23da03b | |||
1c30fb9995 | |||
b94b61ba5d | |||
26c3245cf3 | |||
1510dc2e8d | |||
d949188a34 |
@@ -31,7 +31,7 @@ def signal_handler(sig, frame):
|
|||||||
signal.signal(signal.SIGINT, signal_handler)
|
signal.signal(signal.SIGINT, signal_handler)
|
||||||
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.9"
|
VERSION="1.0.10"
|
||||||
# print(file_path)
|
# print(file_path)
|
||||||
# print(dir_path)
|
# print(dir_path)
|
||||||
os.chdir(dir_path)
|
os.chdir(dir_path)
|
||||||
@@ -110,7 +110,6 @@ for o, a in opts:
|
|||||||
elif o in ("-r", "--restore"):
|
elif o in ("-r", "--restore"):
|
||||||
_RESTORE = True
|
_RESTORE = True
|
||||||
_APP = a
|
_APP = a
|
||||||
print("RESTORE")
|
|
||||||
elif o in ("-D", "--dry"):
|
elif o in ("-D", "--dry"):
|
||||||
_EXECUTE = False
|
_EXECUTE = False
|
||||||
elif o in ("-T", "--dry"):
|
elif o in ("-T", "--dry"):
|
||||||
@@ -241,9 +240,12 @@ if _STOP:
|
|||||||
cmnd = f"docker stop {c.split()[-1]}"
|
cmnd = f"docker stop {c.split()[-1]}"
|
||||||
status, running_containers = subprocess.getstatusoutput(cmnd)
|
status, running_containers = subprocess.getstatusoutput(cmnd)
|
||||||
def restore_job(_APP):
|
def restore_job(_APP):
|
||||||
|
#global VERSION
|
||||||
logging.info("Starting Restore")
|
logging.info("Starting Restore")
|
||||||
|
print(f"Starting restore : {VERSION}")
|
||||||
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")
|
||||||
|
_DATE = "pick"
|
||||||
if _APP == "all":
|
if _APP == "all":
|
||||||
_DATE = "latest"
|
_DATE = "latest"
|
||||||
if host == "rpi5.home.lan" or host == "rpi5":
|
if host == "rpi5.home.lan" or host == "rpi5":
|
||||||
@@ -256,6 +258,7 @@ def restore_job(_APP):
|
|||||||
#input("????")
|
#input("????")
|
||||||
else:
|
else:
|
||||||
_APP = _APP.split(",")
|
_APP = _APP.split(",")
|
||||||
|
|
||||||
PROGRESS = 0
|
PROGRESS = 0
|
||||||
topic = "sectorq/amd/restore"
|
topic = "sectorq/amd/restore"
|
||||||
step = 100 / len(_APP)
|
step = 100 / len(_APP)
|
||||||
@@ -277,7 +280,7 @@ def restore_job(_APP):
|
|||||||
if _DATE == "pick":
|
if _DATE == "pick":
|
||||||
cmnd = f"ssh root@amd.home.lan 'ls {BACKUP_DEVICE}/backup/m-server/docker_data'"
|
cmnd = f"ssh root@amd.home.lan 'ls {BACKUP_DEVICE}/backup/m-server/docker_data'"
|
||||||
status, output = subprocess.getstatusoutput(cmnd)
|
status, output = subprocess.getstatusoutput(cmnd)
|
||||||
print(output)
|
# print(output)
|
||||||
dates = output.splitlines()
|
dates = output.splitlines()
|
||||||
n = 1
|
n = 1
|
||||||
for i in dates:
|
for i in dates:
|
||||||
|
Reference in New Issue
Block a user