mirror of
https://gitlab.sectorq.eu/jaydee/python.git
synced 2025-12-14 10:44:52 +01:00
bitwarden
This commit is contained in:
@@ -141,7 +141,6 @@ while not is_port_open(BACKUP_HOST, port):
|
|||||||
print(f"Port {port} on {BACKUP_HOST} is open.")
|
print(f"Port {port} on {BACKUP_HOST} is open.")
|
||||||
|
|
||||||
if _RESTORE:
|
if _RESTORE:
|
||||||
for b in backups[host]:
|
|
||||||
topic = "sectorq/omv/backups/{}".format(b.lower())
|
topic = "sectorq/omv/backups/{}".format(b.lower())
|
||||||
client.connect(broker,1883,60)
|
client.connect(broker,1883,60)
|
||||||
msg = {"status":"inactive","bak_name":b,"start_time":"inactive","end_time":"inactive","progress":0}
|
msg = {"status":"inactive","bak_name":b,"start_time":"inactive","end_time":"inactive","progress":0}
|
||||||
@@ -195,7 +194,7 @@ if _RESTORE:
|
|||||||
# rsync --info=progress2 -avz --delete /share/docker_data/ --link-dest /m-server/docker_data/latest --exclude="gitlab/data/" --exclude="esphome/config/.esphome" --exclude="gitlab/logs/prometheus" --exclude=".cache" --exclude=".git" --exclude="var_lib_motioneye" /m-server/m-server/docker_data/newone1
|
# rsync --info=progress2 -avz --delete /share/docker_data/ --link-dest /m-server/docker_data/latest --exclude="gitlab/data/" --exclude="esphome/config/.esphome" --exclude="gitlab/logs/prometheus" --exclude=".cache" --exclude=".git" --exclude="var_lib_motioneye" /m-server/m-server/docker_data/newone1
|
||||||
|
|
||||||
|
|
||||||
# input("????")
|
# input("????")
|
||||||
|
|
||||||
status, output = subprocess.getstatusoutput(cmnd)
|
status, output = subprocess.getstatusoutput(cmnd)
|
||||||
|
|
||||||
@@ -203,7 +202,7 @@ if _RESTORE:
|
|||||||
|
|
||||||
#print(cmnd)
|
#print(cmnd)
|
||||||
print("Removing latest link")
|
print("Removing latest link")
|
||||||
# input("????")
|
# input("????")
|
||||||
if _EXECUTE:
|
if _EXECUTE:
|
||||||
status, output = subprocess.getstatusoutput(cmnd)
|
status, output = subprocess.getstatusoutput(cmnd)
|
||||||
if _FIRST:
|
if _FIRST:
|
||||||
@@ -212,18 +211,18 @@ if _RESTORE:
|
|||||||
cmnd = f"ssh root@omv.home.lan 'cd {NEW_BACKUP_DIR}; ln -s {DATETIME} latest'"
|
cmnd = f"ssh root@omv.home.lan 'cd {NEW_BACKUP_DIR}; ln -s {DATETIME} latest'"
|
||||||
print("Creating new latest link")
|
print("Creating new latest link")
|
||||||
#print(cmnd)
|
#print(cmnd)
|
||||||
# input("????")
|
# input("????")
|
||||||
if _EXECUTE:
|
if _EXECUTE:
|
||||||
status, output = subprocess.getstatusoutput(cmnd)
|
status, output = subprocess.getstatusoutput(cmnd)
|
||||||
|
|
||||||
|
|
||||||
#Remove old
|
#Remove old
|
||||||
print("Removing old dirs")
|
print("Removing old dirs")
|
||||||
# input("????")
|
# input("????")
|
||||||
#cmnd = "find {} -maxdepth 1 -type d -mtime +30 -exec rm -rf {{}} \;".format(BACKUP_DIR)
|
#cmnd = "find {} -maxdepth 1 -type d -mtime +30 -exec rm -rf {{}} \;".format(BACKUP_DIR)
|
||||||
cmnd = f"cd {NEW_BACKUP_DIR} find ./ -maxdepth 1 -type d -mmin +30 -exec rm -rf {{}} \\;"
|
cmnd = f"cd {NEW_BACKUP_DIR} find ./ -maxdepth 1 -type d -mmin +30 -exec rm -rf {{}} \\;"
|
||||||
#print(cmnd)
|
#print(cmnd)
|
||||||
# input("????")
|
# input("????")
|
||||||
if _EXECUTE:
|
if _EXECUTE:
|
||||||
status, output = subprocess.getstatusoutput(cmnd)
|
status, output = subprocess.getstatusoutput(cmnd)
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
|
|||||||
Reference in New Issue
Block a user