mirror of
https://gitlab.sectorq.eu/jaydee/python.git
synced 2025-12-14 02:34:53 +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.")
|
||||
|
||||
if _RESTORE:
|
||||
for b in backups[host]:
|
||||
topic = "sectorq/omv/backups/{}".format(b.lower())
|
||||
client.connect(broker,1883,60)
|
||||
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
|
||||
|
||||
|
||||
# input("????")
|
||||
# input("????")
|
||||
|
||||
status, output = subprocess.getstatusoutput(cmnd)
|
||||
|
||||
@@ -203,7 +202,7 @@ if _RESTORE:
|
||||
|
||||
#print(cmnd)
|
||||
print("Removing latest link")
|
||||
# input("????")
|
||||
# input("????")
|
||||
if _EXECUTE:
|
||||
status, output = subprocess.getstatusoutput(cmnd)
|
||||
if _FIRST:
|
||||
@@ -212,18 +211,18 @@ if _RESTORE:
|
||||
cmnd = f"ssh root@omv.home.lan 'cd {NEW_BACKUP_DIR}; ln -s {DATETIME} latest'"
|
||||
print("Creating new latest link")
|
||||
#print(cmnd)
|
||||
# input("????")
|
||||
# input("????")
|
||||
if _EXECUTE:
|
||||
status, output = subprocess.getstatusoutput(cmnd)
|
||||
|
||||
|
||||
#Remove old
|
||||
print("Removing old dirs")
|
||||
# input("????")
|
||||
# input("????")
|
||||
#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 {{}} \\;"
|
||||
#print(cmnd)
|
||||
# input("????")
|
||||
# input("????")
|
||||
if _EXECUTE:
|
||||
status, output = subprocess.getstatusoutput(cmnd)
|
||||
now = datetime.datetime.now()
|
||||
|
||||
Reference in New Issue
Block a user