# Create list of files in the tar file.Most of the Linux files that can be downloaded from the Internet are compressed with a tar, tar.gz and tar.bz2 compression formats and it is important to know how to extract such files. ![]() #!/usr/bin/env bashĮcho "Using temporary file: '$TAR_FILE_CONTENTS_PATH'"Įcho "File doesn't exist '$TAR_FILE_PATH'" Someone might still find this script useful with small-ish files (few GBs). Unfortunately, this does not seem to be the case and the extract/delete loop is terribly slow. The hope is that tar will just 'kind-of' truncate the tar file instead of overwriting it on each file removal. It creates a list of files in tar and extracts them in reverse order. I transferred a 3TB tar file to a 4TB remote drive which took 24 hours, so I too wasn't keen on repeating the process. Mine does, but if you run the above script on a system without these requirements, you'll loose all the data in archive.tar.Īnd in any case something other than that goes wrong, you'll loose all the data in archive.tar anyway, so make sure you have a backup of your data. Note that for all this to work, your shell, tail and truncate must handle 64-bit integers correctly (you don't need a 64-bit computer nor operating system for that). You'll never know if the first terminal ( tar) has actually finished processing the contents of the fifo, so if you prefer you can run this instead, but you won't have the possibility to seamlessly exchange chunks with another disk : chunkprefix="chunk_" Of course this is all haute voltige, you'll want to check everything is ok on a dummy archive first, because if you make a mistake then goodbye data.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |