diff --git a/config.yaml-example b/config.yaml-example index 9f335c3..4cb986a 100644 --- a/config.yaml-example +++ b/config.yaml-example @@ -21,6 +21,8 @@ gitlab: backup: # Create separate directory for every project project_dirs: False + # Create separate directory (under the project directory, if project_dirs: True) for the regularity + regularity_dirs: False # Destination of the exports/backups destination: "/data/backup" diff --git a/gitlab-project-export.py b/gitlab-project-export.py index 2f0f516..bb452d5 100755 --- a/gitlab-project-export.py +++ b/gitlab-project-export.py @@ -83,10 +83,11 @@ print("Exporting %s" % (project)) # Download project to our destination + destination = c.config["backup"]["destination"] if c.config["backup"]["project_dirs"]: - destination = c.config["backup"]["destination"] + "/" + project - else: - destination = c.config["backup"]["destination"] + destination = destination + "/" + project + if c.config["backup"]["regularity_dirs"]: + destination = destination + "/" + args.regularity # Create directories if not os.path.isdir(destination):