Compare commits
2 Commits
973d5487a0
...
e46bfb136a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e46bfb136a | ||
|
|
6b214fb577 |
@@ -1,4 +1,5 @@
|
|||||||
[backandup]
|
[backandup]
|
||||||
|
yamllocation=location of docker-compose.yml
|
||||||
bindcludepattern=list of fixed strings
|
bindcludepattern=list of fixed strings
|
||||||
bindexcludepattern=list of fixed strings
|
bindexcludepattern=list of fixed strings
|
||||||
composefile=path to the docker-compose file to parse
|
composefile=path to the docker-compose file to parse
|
||||||
|
|||||||
15
main.py
15
main.py
@@ -199,8 +199,11 @@ def backup_services(servicename: str, servicesdict: dict, composefilepath: str)
|
|||||||
if len(servicesdict[servicename]["must_before"]):
|
if len(servicesdict[servicename]["must_before"]):
|
||||||
for dependencie in servicesdict[servicename]["must_before"]:
|
for dependencie in servicesdict[servicename]["must_before"]:
|
||||||
if arguments.bindexclude not in ("", None) and dependencie.find(arguments.bindexclude) != -1:
|
if arguments.bindexclude not in ("", None) and dependencie.find(arguments.bindexclude) != -1:
|
||||||
|
# on a un filtre d'exclusion et il matche, donc on ne backup pas
|
||||||
|
continue
|
||||||
|
elif arguments.bindinclude not in ("", None) and dependencie.find(arguments.bindinclude) != -1:
|
||||||
|
#on a un filtre d'inclusion et il ne matche pas, donc on ne backup pas
|
||||||
continue
|
continue
|
||||||
elif arguments.bindinclude not in ("", None) and dependencie.find(arguments.bindinclude):
|
|
||||||
backup_services(dependencie, servicesdict, composefilepath)
|
backup_services(dependencie, servicesdict, composefilepath)
|
||||||
|
|
||||||
# TODO: faire la sauvegarde
|
# TODO: faire la sauvegarde
|
||||||
@@ -222,6 +225,16 @@ def backup_services(servicename: str, servicesdict: dict, composefilepath: str)
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
def get_containers_names_and_ids(ymlfile: str) -> list:
|
||||||
|
'''
|
||||||
|
Retrouve les noms et ID des containers contenus dans le fichier yaml. docker-compose les trie
|
||||||
|
par ordre alphabétique par défaut
|
||||||
|
:param ymlfile: str: fichier yaml à parser/utiliser
|
||||||
|
:return: list
|
||||||
|
'''
|
||||||
|
|
||||||
|
|
||||||
# Press the green button in the gutter to run the script.
|
# Press the green button in the gutter to run the script.
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
dockerhost = docker.from_env()
|
dockerhost = docker.from_env()
|
||||||
|
|||||||
Reference in New Issue
Block a user