The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
gunzip error - not in gzip format eagercyber UNIX for Dummies Questions & Answers 5 05-29-2008 12:58 AM
GZIP ERROR! -- Plesae help! -- Urgent sumitc AIX 2 05-05-2008 07:55 PM
tar and gzip tungaw2004 UNIX for Dummies Questions & Answers 3 06-22-2007 12:21 AM
TAR and GZIP help VandeMatram UNIX for Dummies Questions & Answers 3 03-17-2006 04:35 AM
gzip mfran2002 SCO 1 12-01-2003 07:23 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 12-14-2005
Cameron's Avatar
Registered User
 

Join Date: Nov 2001
Location: Brisbane, Australia
Posts: 490
An error with gzip

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.

Code:
  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.
Reply With Quote
Forum Sponsor
  #2  
Old 12-16-2005
Just Ice's Avatar
Lights on, brain off.
 

Join Date: Mar 2005
Location: in front of my computer
Posts: 629
if a script works fine when run manually and breaks when run from cron, this usually suggests an environment issue --- most likely PATH ... i did a quick check of "man gzip" and didn't see anything there that would make the gzip command in the script break in non-interactive mode
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 06:12 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0