Due to some runaway poor scripting some files meant to be archived were compressed five or six times over. So there are files like this:
a_log_file_0.log.1.tar.gz.tar.gz.tar.gz.tar.gz.tar.gz
Please how can I fix problematic files like this?
Due to some runaway poor scripting some files meant to be archived were compressed five or six times over. So there are files like this:
a_log_file_0.log.1.tar.gz.tar.gz.tar.gz.tar.gz.tar.gz
Please how can I fix problematic files like this?
You'll have to un-tar all the levels of tar that have been applied to your file. If your file has been created by something like
tar czf a_log_file_0.log.1.tar.gz a_log_file_0.log.1
tar czf a_log_file_0.log.1.tar.gz.tar.gz a_log_file_0.log.1.tar.gz
...
you can un-tar it step by step like so:
tar xzf a_log_file_0.log.1.tar.gz.tar.gz.tar.gz.tar.gz.tar.gz
tar xzf a_log_file_0.log.1.tar.gz.tar.gz.tar.gz.tar.gz
tar xzf a_log_file_0.log.1.tar.gz.tar.gz.tar.gz
---
You may want to make sure, that the tar.gz files don't contain other stuff which would ruin your system being un-tar
ed to the wrong place, maybe overwriting important data.
You may want to make sure that you have enough disk space where you extract multiple levels of tar-ed files.
you may want to remove the intermediate extracted versions of your files.
If you have done that by hand for several such tar files and only if you are sure that there is only one file in each gzip-ed tar archive, you may want to automate the multi level extraction like this:
file=a_log_file_0.log.1.tar.gz.tar.gz.tar.gz.tar.gz.tar.gz
cp $file /tmp/
cd /tmp/
while echo $file | grep -n \\.tar\\..gz
do
zfile=${file%.tar.gz}
tar xzf $file
rm $file
file=$zfile;
done
If names are unexpectedly different from the names in this short scropt, it will not work - intentionally, because the multiple tar archive structure is not the way it is expected.
Have fun extracting!