I have set of large number of files to be archived in a linux server. I need to compress those files in to set of 1GB compressed files.
I am using gzip to compress the files but I don't know the final size of the compressed folders until I really compressed the files. I am using below command to get the final size of the compressed file but it's not really efficient as I need to keep adding new files and compress until I get the desired final size.
tar -czf - /path/to/compressed-directory | wc -c Is there an efficient way to do this? Or should I consider compressing individual files and then create the final archive using individual compressed files?