tar or cpio out there, or a smarter way to archive, to efficiently retrieve a file stored in the archive?tar to archive a group of very large (multi-GB) bz2 files.tar -tf file.tar to list the files within the archive, this takes a very long time to complete (~10-15 minutes).cpio -t < file.cpio takes just as long to complete, plus or minus a few seconds.tar -xf file.tar myFileOfInterest for example) is as slow.tar or cpio) that allows efficient retrieval of a file within the archive?>
dar can use compression. By default no compression is used.So you don't need to do anything to exclude your bz2 files unless you explicitly turn on compression. I thought for some reason compression defaulted to on, but I was wrong. I think because I just always use it that way in my backup scripts. Anyway...
even using compression dar has not to read the whole backup to extract one file. This way if you just want to restore one file from a huge backup, the process will be much faster than using tar. Dar first reads the catalogue (i.e. the contents of the backup), then it goes directly to the location of the saved file(s) you want to restore and proceed to restoration. [...](Emph. mine)
$ time tar -xvf dar.tar dar-2.3.9/NEWS dar-2.3.9/NEWS real 0m0.101s user 0m0.014s sys 0m0.080sCompared to dar:
$ time dar -O -x dar -g dar-2.3.9/NEWS [output removed] real 0m0.122s user 0m0.075s sys 0m0.037sThen I tried it using a single file from a 315MB dataset consisting mostly of small files; again here's tar:
real 0m0.481s user 0m0.056s sys 0m0.411sAnd then dar:
real 0m0.101s user 0m0.058s sys 0m0.036sSo as you increase the size of the archive, the difference between tar and dar starts to become more and more apparent. I suspect if you tried it with some multigigabyte files, you'd see a serious time savings.
dar. Is it possible to extract a file to standard output? It seems possible to pipe the archive to standard output, but I can't see what options to use to extract a file to stdout.7z, which looks very promising.dar. Is it possible to extract a file to standard output? It seems possible to pipe the archive to standard output, but I can't see what options to use to extract a file to stdout."bz2 (bzip2) files.You are not logged in, either login or create an account to post comments
I don't know for a fact that it's any faster to retrieve files than tar, but the archive format is different and is aimed at modern storage devices rather than linear tape, so it wouldn't surprise me if it was. It normally compresses files by default (unlike tar) but it has a commandline switch to exclude certain file extensions like .gz or .bz2.
If I get a chance tonight I'll run some tests and see if dar is faster to retrieve files from an archive.
posted by Kadin2048 at 5:05 PM on August 27