Have an issue with the following snippet of code, in particular the execution of the `gzip -9 ${ARCHIVE_FILE}`.
It is failing with a ReturnCode of 1 - Can anyone lead me to a souce that identifies & describes what RC's there are for gzip, as I've not been able to find any.
echo '-- TARing up '${RUNTYPE}' files ...'
tar -cVf ${ARCHIVE_FILE} \
${File1} \
${File2}
TAR_RC=$?
if [ ${TAR_RC} -ne 0 ] ; then
echo ${0}' : ** ERROR w/- '${MKT}'('${RUNTYPE}') ARCHIVE file.'
echo 'Error Code: '${TAR_RC}
##- Alert Notification -##
EMAIL_WHO=${EMAIL_SUPPORT},${SMS_ALERT}
EMAIL_SUB="${0} : ** ERROR w/- ${MKT}(${RUNTYPE}) ARCHIVE file."
EMAIL_BDY="An error has occurred with the creation of the ${MKT}(${RUNTYPE}) Archive file (${ARCHIVE_FILE}).\n\nPlease investigate and resolve accordingly.\n\nError Code: ${TAR_RC}"
Alert_Email
else
##- Continue with GZIP after successful TAR -##
echo ''
echo '-- GZIPing Archive(.tar) file ...'
echo '-- TAR File: '${ARCHIVE_FILE}
if [ -f ${ARCHIVE_FILE}.gz.old ] ; then
mv ${ARCHIVE_FILE}.gz.old ${ARCHIVE_FILE}.gz.older
fi
if [ -f ${ARCHIVE_FILE}.gz ] ; then
mv ${ARCHIVE_FILE}.gz ${ARCHIVE_FILE}.gz.old
fi
gzip -9 ${ARCHIVE_FILE}
GZIP_RC=$?
if [ ${GZIP_RC} -ne 0 ] ; then
##- Problem w/- GZIP -##
echo ${0}' : ** ERROR w/- '${MKT}'('${RUNTYPE}') GZIP file.'
echo 'Error Code: '${GZIP_RC}
##- Alert Notification -##
EMAIL_WHO=${EMAIL_SUPPORT},${SMS_ALERT}
EMAIL_SUB="${0} : ** ERROR w/- ${MKT}(${RUNTYPE}) GZIP file."
EMAIL_BDY="An error has occurred with the creation of the ${MKT}(${RUNTYPE}) GZIP file (${ARCHIVE_FILE}.gz).\n\nPlease investigate and resolve accordingly.\n\nError Code: ${GZIP_RC}"
Alert_Email
fi
The `gzip` step executes as expected when performed manually.
Any assistance appreciated.