Skip to content
Snippets Groups Projects
Commit 72451d7a authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

FIX: fix path and use of env var

parent 8cdb5c7a
No related branches found
No related tags found
No related merge requests found
...@@ -43,14 +43,15 @@ out : str ...@@ -43,14 +43,15 @@ out : str
A YAML text representation of the backup process. A YAML text representation of the backup process.
""" """
command = ["./utils/backup.sh"] utils_path = os.path.dirname(__file__)
command = [os.path.join(utils_path, "backup.sh")]
env = os.environ.copy() env = os.environ.copy()
if not directory: if not directory:
os.makedirs("/tmp/caosdb/tmpfiles/backup/", exist_ok=True) os.makedirs("/tmp/caosdb/tmpfiles/backup/", exist_ok=True)
directory = tempfile.mkdtemp(dir="/tmp/caosdb/tmpfiles/backup/", directory = tempfile.mkdtemp(dir="/tmp/caosdb/tmpfiles/backup/",
prefix="backup.") prefix="backup.")
env["BACKUPDIR"] = directory env["BACKUPDIR"] = directory
result = subprocess.run(command, cwd=os.path.dirname(__file__), env=env) result = subprocess.run(command, cwd=os.path.dirname(__file__), env=env)
......
File moved
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment