From fcf78240dff77d6a44d0ee0a5ed22d50eae381d4 Mon Sep 17 00:00:00 2001 From: Dave Date: Mon, 20 Apr 2020 17:50:02 +0800 Subject: [PATCH] Subdirectories for different regularities. The regularity directories are subdirectories of the project directories. --- config.yaml-example | 2 ++ gitlab-project-export.py | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) 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):