I have a tar file with name DTT012_GP_20140207.tar and many more with different names of different sizes ranging from 1GB to 4GB.
Now my requirement is to extract/not extract these files and then divide it into various parts of size 500MB and save it with different names and then compress it(zip/tar).
(If 1GB tar file, it should divide into 2 500MB,
If 1.6GB file, it should divide into 2 500MB and the remanning 100MB into another)
If it was me, and if I understand you correctly, I would simply untar ( tar -xvf ) the original file (or tar -xvzf if gzipped), and then split it into multiple parts and then tar them up again and recompress ( tar -cvzf )
Thanks.
But will that serve the purpose??
I want the files from the 1GB tar file (data.tar- untarred to data) to be copied into two separate folders as data_part1 and data_part2 and then recompress these two folders.
Contents inside the tar file are more file1.gz,file2.gz,file3.gz... and so on..
file1.gz,file2.gz (assuming it to be less than or equal to 500MB) should be copied to file1 and then compress to data_part1.zip and then remaining files(file3.gz,file4.gz...) assuming them to total another 500MB and copy to data_part2 and then compress to data_part.zip
Can you or any other Unix expert help me with that??
Well, your second post describes quite a different problem than your first post.
What script have you written?
Our amazing members are not here to write your scripts for you, but to assist you in your (best) efforts to define your problem and write your own scripts.