Skip to content

Commit b5e3dd0

Browse files
committed
Add provenance cfg to output dir
1 parent b317c89 commit b5e3dd0

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

zppy/__main__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
import importlib
44
import io
55
import os
6+
import shutil
7+
from datetime import datetime, timezone
68
from typing import Any, List, Tuple
79

810
from configobj import ConfigObj
@@ -48,8 +50,11 @@ def main():
4850
output = output.replace("$USER", username)
4951
script_dir = os.path.join(output, "post/scripts")
5052
job_ids_file = os.path.join(script_dir, "jobids.txt")
53+
ts_utc = datetime.now(timezone.utc).strftime("%Y%m%d_%H%M%S_%f")
54+
provenance = os.path.join(script_dir, f"provenance.{ts_utc}.cfg")
5155
try:
5256
os.makedirs(script_dir)
57+
shutil.copy(args.config, provenance)
5358
except OSError as exc:
5459
if exc.errno != errno.EEXIST:
5560
raise OSError("Cannot create script directory")

0 commit comments

Comments
 (0)