Skip to content

Commit

Permalink
Subdirectories for different regularities.
Browse files Browse the repository at this point in the history
The regularity directories are subdirectories of the project 
directories.
  • Loading branch information
dazsmith committed Apr 20, 2020
1 parent bffad6f commit fcf7824
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions config.yaml-example
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 4 additions & 3 deletions gitlab-project-export.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit fcf7824

Please sign in to comment.