in reply to Question on Archive::Tar vs Archive::TarGzip
Did your attempt look anything like this?
Note that the total size of the directory being treated is an important factor; if it's really big (i.e. >= your machine's RAM), Archive::Tar will cause trouble, because all the data needs to be memory resident (with substantial overhead) before a tar file can be written. "Trouble" here could mean anything from "just slows everything down a lot" (because of massive virtual memory swapping) to "blue screen of death" (due to some critical state caused by over-consumption of resources).perl -MFile::Find -MArchive::Tar -e "$t=Archive::Tar->new(); find(sub{-f && $t->add_files($_)},$ARGV[0]); $t->write(join('.',$ARGV[0].'tar')" some_path
If there are ways to break up a large data set into pieces of reasonable size (and if it's not absurd to make a separate tar file for each piece), then that will be the way to go.
I just tried a command line like the one above (but with different quotes, because I prefer a bash shell -- I'm not sure if the snippet as posted would actually work in cmd.exe). It did the job -- even with a directory tree totaling 2.3 GB of data; I happened to have an 8 GB swap file. (But I wasn't using windows, so YMMV.)
(updated last paragraph, trying to clarify about the quoting issue -- and regarding memory size, I have 2G of RAM, but the total process size for that command went well over 3G)
I'll add one more comment: Being on windows is not a good excuse for not having a proper compiled GNU tar tool. If you don't have admin privilege on the box, the question becomes: why can't your admin person provide this tool for you? If you have perl on the box, you should be able to get at least some amount of cygwin or uwin or some other flavor of unix-for-windows tools (including a bash shell, while you're at it).
Last additional comment: Why is a zip file not good enough, given that you were already able to create that easily? Virtually every OS on every kind of hardware has a tool available for reading zip files, and this has been true for a long time. Worst case: make a zip file, send it to a friend who is better equipped than you are, and have them repackage it in tar format for you.
|
|---|