[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Tarsnap hangs for 8-9 minutes after restoring one file
Tim McCormack <email@example.com> wrote:
> I recently had occasion to restore a 700 kB file from several archives.
> The file was retrieved within seconds, but tarsnap continued to hold
> open a connection to something in Amazon EC2 (I assume the tarsnap
> service) for 8 to 9 minutes. What is it doing, and how can it be made
> faster, besides killing the process once I see the file is retrieved?
Hi! Yep, the tarsnap service is hosted through Amazon (in New Jersey, I think)
There is nothing in the tar format stopping a file existing more than once,
and anywhere in the archive. Therefore to ensure complete compatibility
with tar, tarsnap has to go through the whole archive irrespective of
whether it's found a match or not.
However, tarsnap does have the "-q" option to do what you want. From the
-q (--fast-read) (x and t modes only) Extract or list only the first archive
entry that matches each pattern or filename operand. Exit as
soon as each specified pattern or filename has been matched.
By default, the archive is always read to the very end, since
there can be multiple entries with the same name and, by
convention, later entries overwrite earlier entries.
This option is provided as a performance optimization.