gzip issue?

I have unix file to gzip few files like below

xyz.ksh
 !/bin/ksh
 .
 .
 gzip  d1/*txt d1/*dat
  
 .
 .
 .
  

There are 5 .txt files in d1 directory.

out of 5 files one file is not getting zipped.

I checked and found that the unzipped file size is more than 2 GB.

But I manually able to zip the file.

There is sufficient disk space available.

I do not think its space issue.

could anybody help me out here.

Thank you in advance.
Abhi

abhiabhi,

  1. You say there are 5.txt files in d1 directory, but you have *dat as well? Are these files being zipped as expected?
  2. Can you list contents of d1 before and after you run gzip?
  3. What is the output of the script execution? e.g. is gzip returning an error?
  4. List the entire script.

Sir,

1.Yes I have .dat files as well .txt files in d1 floders
.dat files are very small size
2.only one file is >2GB, rest are around 1 GB

3.all looks good to me.there is no error encountered.
4.its simply not zipping the file

What version of gzip you are running ?. Is the destination filesystem same as the current one where the source file is residing ?. If not, does the destination file system has large file support.

By the looks of it, you may be running an older version of gzip which has a limitation of 2gb file size. Please check the newer version or try bzip.

Hi Thanks for information,
but i do not think its a verison issue as i am able to gzip thel fine manually.
Also I am gzipping and keeping same directory. tehre is mor ethan 20 GB space free.

How many files are there in the directory? You could be hitting the limits of how many files you can fit in a single commandline.

Could you post the real full path file that you say it doesn't zip? Perhaps, copy and paste the result of ls -l </path/to/filename.dat>

---------- Post updated at 12:01 PM ---------- Previous update was at 11:39 AM ----------

If this were the case, you would be getting an error condition E2BIG, and the OP says that not errors occur.

1 Like

I checked and gzip version is as
$ gzip -V
gzip 1.3.5
my server is :SunOS machine Generic_142900-15 sun4u sparc SUNW,Sun-Fire-V440

is this gzip version is the cause. I am not seeing any error will running the script.
Intrestingly the >2GB file is getting zip manually

1.3.5 is the very first version to support files > 4GB.

-rw-r--r-- 1 Oabx xys 2946577586 Oct 1 05:31 f1.txt

There are 7 files to zip one is missing and rest 6 are zipping.