Hi,

I am trying to compress one sql file using the below tar command. But it is
getting failed without any warnings or exceptions in the error log.

Syntax: tar --warning=no-file-changed -zcvf
$bkpdir${hadoopdb}_mysqldb_$bkpday.sql.tar.gz
$bkpdir${hadoopdb}_mysqldb_$bkpday.sql

Is there any way to catch the error when executing the above command.

My Code snippet looks like this.

   tar --warning=no-file-changed -zcvf
$bkpdir${hadoopdb}_mysqldb_$bkpday.sql.tar.gz
$bkpdir${hadoopdb}_mysqldb_$bkpday.sql

   if [ "$?" != 0 ]
   then
      echo "Error while compressing the db backup file"
      errmsg
      exit 1
   fi

Error Message: Error while compressing the db backup file

TAR Version : 1.23

Please do the needful.

Regards,
Sandeep.v

Reply via email to