gunzip status


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting gunzip status
# 1  
Old 07-28-2011
gunzip status

Hi,
I'm trying to run my application on HP-UX server.
I have to extract a *.tar.gz file.
I'm doing that now in 2 steps.
first I gunzip it and then pax it.
My question is how can I check whether the data in the *.tar.gz file is corrupted or not??

Now, I'm trying to do this
Code:
gunzip_status=`gunzip -f $dir1/$filename.tar.gz`
if { ( echo $gunzip_status | grep invalid >/dev/null ) } then
            echo "$filename.tar.gz is corrupted "
            mailx -s "File $filename.tar.gz is corrupted "        email@server.com < gunzip_err.txt
        else
            pax -v -r -s ',//*log_recv/di/data/interface//*,,' -f $filename.tar
        fi

and it is not working Smilie
Any advice???? cos there are chances that the incoming file maybe corrupted.
# 2  
Old 07-28-2011
Read gunzip manual for option. I'll suggest gunzip -qt file and test the exit value $?, 0 is OK , anything else is failure.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

How to track table status delete/update/insert status in DB2 V10 z/os?

Dear Team I am using DB2 v10 z/os database . Need expert guidance to figure out best way to track table activities ( Ex Delete, Insert,Update ) Scenario We have a table which is critical and many developer/testing team access on daily basis . We had instance where some deleted... (1 Reply)
Discussion started by: Perlbaby
1 Replies

2. Shell Programming and Scripting

Help with gunzip

Hi All, I have a file "HOTEL_INFO.zip" and getting the below errors: server1:/home/arun# gunzip -S .zip HOTEL_INFO.zip gunzip: HOTEL_INFO.zip: first entry not deflated or stored -- use unzip server1:/home/arun#unzip HOTEL_INFO.zip ksh: unzip: not found. ... (11 Replies)
Discussion started by: Arunprasad
11 Replies

3. UNIX for Dummies Questions & Answers

gunzip

I have a zip file as a.zip and it contains 1m xml files. like a1.xml, a2.xml.... The size is also very big nearly 1GB. I want to extract only a123.xml. Can any one help how can I do this? (1 Reply)
Discussion started by: siba.s.nayak
1 Replies

4. Shell Programming and Scripting

Help on gunzip

Hi All, I am using UNIX command to unzip the files gzip -d9 DW_*.gz The Xmls are compressed using gzip and it is received in the .gz format at UNIX box which need to be uncompressed. The above command is working fine for 400 compressed xmls(.gz files) but when the count becomes 401 or more i... (7 Replies)
Discussion started by: Codesearcher
7 Replies

5. Red Hat

Installing RedHat 8.0 onto Dell PowerEdge SC1425 - hdc: status error: status = 0x58

I have successfully installed RedHat 8.0 onto a Dell PowerEdge SC1425 today. This server has two SATA hard drives, and an IDE DVD-ROM drive. Using the following kernel parameters, i successfully installed across both hard drives from CD: ide0=0x1f0,0x3f6,14 vga=791 resolution=1024x768 expert... (5 Replies)
Discussion started by: fishsponge
5 Replies

6. Shell Programming and Scripting

check the status and send an email with status

Hi, We have a text file which has the following data. ISA~00~ ~00~ ~ZZ~VISTN ~ZZ~U1CAD ~051227~183 7~U~00200~000011258~0~P~< GS~FA~EE05J~U1CAD~051227~1831~000011258~X~002002 ST~997~0001 AK1~SH~247 AK2~856~2470001 AK5~A AK2~856~2470002 AK5~A... (3 Replies)
Discussion started by: isingh786
3 Replies

7. UNIX for Dummies Questions & Answers

gunzip error

While trying to gunzip afile I get the following error message ls -l UK_US_02310.dat.gz -rwxrwxrwx 1 imis abint 348854527 Jan 8 00:17 UK_US_02310.dat.gz gunzip UK_US_02310.dat.gz gunzip: UK_US_02310.dat.gz: invalid compressed data--format violated I can gzcat the file and pipe to... (3 Replies)
Discussion started by: mccoubreyr
3 Replies

8. UNIX for Dummies Questions & Answers

gunzip error

I am trynig to unzip a file with gunzip, and am getting an error 'File too large'. Any ideas on how to get around this? (2 Replies)
Discussion started by: pkappaz
2 Replies

9. UNIX for Dummies Questions & Answers

Gunzip

Hi can't unzip a gz file in TurboLinux 7.0 when i'm trying this gunzip filename.tar.gz it always says not in gzip format what should I do...please help me (4 Replies)
Discussion started by: CreamHarry
4 Replies

10. UNIX for Dummies Questions & Answers

Couldn't open status file /var/samba/STATUS.LCK

I believe i have most of samba configured right but i get this error each time time try to run it. I was given suggestion that i touch the file, i did, but i still cannot rid myself of this error. Any suggestions (2 Replies)
Discussion started by: macdonto
2 Replies
Login or Register to Ask a Question