Skip to content

Commit

Permalink
Only delete temp restarts if it is the final fcst segment
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterKolczynski-NOAA committed Aug 10, 2024
1 parent 7179c00 commit c73eecd
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion jobs/JGLOBAL_FORECAST
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,17 @@ fi
# Remove the Temporary working directory
##########################################
cd "${DATAROOT}" || true
[[ "${KEEPDATA}" == "NO" ]] && rm -rf "${DATA}" "${DATArestart}" # do not remove DATAjob. It contains DATAoutput
# do not remove DATAjob. It contains DATAoutput
if [[ "${KEEPDATA}" == "NO" ]]; then
rm -rf "${DATA}"

# Determine if this is the last segment
commas="${FCST_SEGMENTS//[^,]}"
n_segs=${#commas}
if (( n_segs - 1 == ${FCST_SEGMENT:0} )); then
# Only delete temporary restarts if it is the last segment
rm -rf "${DATArestart}"
fi
fi

exit 0

0 comments on commit c73eecd

Please sign in to comment.