Skip to content

Commit

Permalink
if no keeping input folder, put into tar archive
Browse files Browse the repository at this point in the history
  • Loading branch information
vieting committed Jul 18, 2024
1 parent e49ffb0 commit 32d0e29
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions sisyphus/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,13 +516,10 @@ def _sis_cleanup(self):
try:
if not gs.JOB_CLEANUP_KEEP_WORK:
shutil.rmtree(os.path.abspath(self._sis_path(gs.JOB_WORK_DIR)))
if not gs.JOB_CLEANUP_KEEP_INPUT:
shutil.rmtree(os.path.abspath(self._sis_path(gs.JOB_INPUT)))
files = [
i
for i in os.listdir(self._sis_path())
if i not in (gs.JOB_OUTPUT, gs.JOB_INFO, gs.JOB_WORK_DIR, gs.JOB_INPUT)
]
files_keep = [gs.JOB_OUTPUT, gs.JOB_INFO, gs.JOB_WORK_DIR]
if gs.JOB_CLEANUP_KEEP_INPUT:
files_keep.append(gs.JOB_INPUT)
files = [i for i in os.listdir(self._sis_path()) if i not in files_keep]
subprocess.check_call(
["tar", "-czf", gs.JOB_FINISHED_ARCHIVE] + files, cwd=os.path.abspath(self._sis_path())
)
Expand Down

0 comments on commit 32d0e29

Please sign in to comment.