It blends!
This commit is contained in:
4
main.py
4
main.py
@@ -156,13 +156,13 @@ def backup_service(servicename: str, servicesdict: dict, composefilepath: str) -
|
||||
'''
|
||||
|
||||
if servicesdict[servicename]["backupdone"]:
|
||||
print("backup is already done, ignoring")
|
||||
return True
|
||||
|
||||
dockerclient = docker.from_env()
|
||||
containersid = os.popen(f"docker-compose --file {composefilepath} ps --quiet {servicename}").read().splitlines()
|
||||
containerrunning = []
|
||||
for containerid in containersid:
|
||||
print(containerid)
|
||||
container = dockerclient.containers.get(containerid)
|
||||
containerrunning.append(container.status == "running")
|
||||
print(f"stopping {container.name}")
|
||||
@@ -173,7 +173,7 @@ def backup_service(servicename: str, servicesdict: dict, composefilepath: str) -
|
||||
backup_service(dependencie, servicesdict, composefilepath)
|
||||
|
||||
# TODO: faire la sauvegarde
|
||||
print(f"starting backup")
|
||||
print(f"doing backup of {servicename}")
|
||||
|
||||
for containerindex in range(0, len(containersid)):
|
||||
if containerrunning[containerindex]:
|
||||
|
||||
Reference in New Issue
Block a user