tar read always the full file ?

Submitted by N0K
on November 6, 2008 - 11:40am

Hello.

I have a doubt about tar. I did a backup with tar to a 1.4TB tape.
Now i need know the restore time, so im restoring a file from the begging, middle and last of the tar backup.
I see the first file is restore fast, but the prompt dont come back, the tar command still is run.
The second file, take along more, but the same, after restoring, the tar command still run.
So my questiong is, when i restore a file, which is into a tar file, the tar command always read the entire tar file ?

Thanks and regards.

Tar always reads the full file

on
November 6, 2008 - 1:32pm

Yes, tar will always read to the end of the tar archive (even with compression) unless you ^C it once you see your file restored. ( Use -v [' tar xpv '] to see filenames as they are processed. )

Try tar -q or tar

Anonymous (not verified)
on
November 6, 2008 - 4:28pm

Try tar -q or tar --fast-read, depending on your version of tar. It will stop after the first hit for each given pattern on the command line.

old versions

on
November 8, 2008 - 4:58am

because the data is on tape, tar cannot remove old versions of files when new ones are added, this would require a seek (rewind) and many tape drives can't synchronize with the existing data and can only append, i.e. data after the write position is lost. thus even the option

       -u, --update
              only append files that are newer than copy in archive

only appends a newer version, but doesn't remove the old one. on restore you have to scan the whole archive if the extracted file has to be replaced by a newer version.

Thanks for the

on
November 10, 2008 - 9:36am

Thanks for the answer!

cdbarra: Experiencias de un sysdebian.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.