From 1893d663661a0352805ccf5366e53663788b835e Mon Sep 17 00:00:00 2001 From: RussTreadon-NOAA Date: Fri, 3 Feb 2023 23:12:10 +0000 Subject: [PATCH] address permission issue with run_jedi_exe_letkf (#223) --- ush/ufsda/stage.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/ush/ufsda/stage.py b/ush/ufsda/stage.py index fa14d346d..582191090 100644 --- a/ush/ufsda/stage.py +++ b/ush/ufsda/stage.py @@ -497,11 +497,12 @@ def background_ens(config): mkdir(jedi_bkg_mem) # copy RESTART to RESTART_GES - try: - shutil.copytree(rst_dir, ges_dir) - except FileExistsError: - shutil.rmtree(ges_dir) - shutil.copytree(rst_dir, ges_dir) + if not os.path.exists(ges_dir): + try: + shutil.copytree(rst_dir, ges_dir) + except FileExistsError: + shutil.rmtree(ges_dir) + shutil.copytree(rst_dir, ges_dir) try: os.symlink(ges_dir, jedi_bkg_dir) except FileExistsError: