Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions scripts/exgdas_enkf_earc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,18 @@ if [ "${ENSGRP}" -eq 0 ]; then

#--set the archiving command and create local directories, if necessary
TARCMD="htar"
HSICMD="hsi"
if [[ ${LOCALARCH} = "YES" ]]; then
TARCMD="tar"
HSICMD=""
[ ! -d "${ATARDIR}"/"${CDATE}" ] && mkdir -p "${ATARDIR}"/"${CDATE}"
fi

set +e
${TARCMD} -P -cvf "${ATARDIR}/${CDATE}/${RUN}.tar" $(cat "${ARCH_LIST}/${RUN}.txt")
status=$?
${HSICMD} chgrp rstprod "${ATARDIR}/${CDATE}/${RUN}.tar"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be nested in an if block to check CHGRP_RSTPROD since S4 and, temporarily, Jet do not have the group. CHGRP_CMD could also be used instead of chgrp, but that's perhaps nitpicky.

${HSICMD} chmod 640 "${ATARDIR}/${CDATE}/${RUN}.tar"
if [ "${status}" -ne 0 ] && [ "${CDATE}" -ge "${firstday}" ]; then
echo "$(echo "${TARCMD}" | tr 'a-z' 'A-Z') ${CDATE} ${RUN}.tar failed"
exit "${status}"
Expand Down
9 changes: 9 additions & 0 deletions scripts/exglobal_archive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,10 @@ if [[ ${HPSSARCH} = "YES" || ${LOCALARCH} = "YES" ]]; then

# --set the archiving command and create local directories, if necessary
TARCMD="htar"
HSICMD="hsi"
if [[ ${LOCALARCH} = "YES" ]]; then
TARCMD="tar"
HSICMD=''
[ ! -d "${ATARDIR}"/"${CDATE}" ] && mkdir -p "${ATARDIR}"/"${CDATE}"
[ ! -d "${ATARDIR}"/"${CDATE_MOS}" ] && [ -d "${ROTDIR}"/gfsmos."${PDY_MOS}" ] && [ "${cyc}" -eq 18 ] && mkdir -p "${ATARDIR}"/"${CDATE_MOS}"
fi
Expand Down Expand Up @@ -255,6 +257,13 @@ for targrp in ${targrp_list}; do
set +e
${TARCMD} -P -cvf "${ATARDIR}"/"${CDATE}"/"${targrp}".tar $(cat "${ARCH_LIST}"/"${targrp}".txt)
status=$?
case ${targrp} in
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As above, should be nested in a CHGRP_RSTPROD if block.

'gdas'|'gdas_restarta')
${HSICMD} chgrp rstprod "${ATARDIR}/${CDATE}/${targrp}.tar"
${HSICMD} chmod 640 "${ATARDIR}/${CDATE}/${targrp}.tar"
;;
*) ;;
esac
if [ "${status}" -ne 0 ] && [ "${CDATE}" -ge "${firstday}" ]; then
echo "$(echo "${TARCMD}" | tr 'a-z' 'A-Z') ${CDATE} ${targrp}.tar failed"
exit "${status}"
Expand Down