mirror of
https://gitlab.sectorq.eu/jaydee/python.git
synced 2025-12-14 02:34:53 +01:00
bitwarden
This commit is contained in:
@@ -94,6 +94,18 @@ backups = {
|
|||||||
"exclude":"",
|
"exclude":"",
|
||||||
"active":True
|
"active":True
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"rpi5":{
|
||||||
|
"docker_data":{
|
||||||
|
"source":"/share/docker_data/",
|
||||||
|
"exclude":"",
|
||||||
|
"active":True
|
||||||
|
},
|
||||||
|
"fail2ban":{
|
||||||
|
"source":"/etc/fail2ban/",
|
||||||
|
"exclude":"",
|
||||||
|
"active":True
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BACKUP_FS = "/srv/dev-disk-by-uuid-2f843500-95b6-43b0-bea1-9b67032989b8"
|
BACKUP_FS = "/srv/dev-disk-by-uuid-2f843500-95b6-43b0-bea1-9b67032989b8"
|
||||||
@@ -187,41 +199,8 @@ if _RESTORE:
|
|||||||
|
|
||||||
ans = input("continue?") or "n"
|
ans = input("continue?") or "n"
|
||||||
if ans == "y" and _EXECUTE:
|
if ans == "y" and _EXECUTE:
|
||||||
|
|
||||||
# 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("????")
|
|
||||||
|
|
||||||
status, output = subprocess.getstatusoutput(cmnd)
|
|
||||||
|
|
||||||
cmnd = f"ssh root@omv.home.lan 'rm -rf {FULL_BACKUP_LATEST}'"
|
|
||||||
|
|
||||||
#print(cmnd)
|
|
||||||
print("Removing latest link")
|
|
||||||
# input("????")
|
|
||||||
if _EXECUTE:
|
|
||||||
status, output = subprocess.getstatusoutput(cmnd)
|
|
||||||
if _FIRST:
|
|
||||||
cmnd = f"ssh root@omv.home.lan 'cd {NEW_BACKUP_DIR}; ln -s initial latest'"
|
|
||||||
else:
|
|
||||||
cmnd = f"ssh root@omv.home.lan 'cd {NEW_BACKUP_DIR}; ln -s {DATETIME} latest'"
|
|
||||||
print("Creating new latest link")
|
|
||||||
#print(cmnd)
|
|
||||||
# input("????")
|
|
||||||
if _EXECUTE:
|
|
||||||
status, output = subprocess.getstatusoutput(cmnd)
|
status, output = subprocess.getstatusoutput(cmnd)
|
||||||
|
|
||||||
|
|
||||||
#Remove old
|
|
||||||
print("Removing old dirs")
|
|
||||||
# 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("????")
|
|
||||||
if _EXECUTE:
|
|
||||||
status, output = subprocess.getstatusoutput(cmnd)
|
|
||||||
now = datetime.datetime.now()
|
now = datetime.datetime.now()
|
||||||
ENDTIME = now.strftime("%Y-%m-%d_%H:%M:%S")
|
ENDTIME = now.strftime("%Y-%m-%d_%H:%M:%S")
|
||||||
msg = {"status":"finished","bak_name":_APP,"start_time":DATETIME,"end_time":ENDTIME,"progress":0}
|
msg = {"status":"finished","bak_name":_APP,"start_time":DATETIME,"end_time":ENDTIME,"progress":0}
|
||||||
|
|||||||
Reference in New Issue
Block a user