[NTLUG:Discuss] tar problem -- ustar is just a streaming I/O format
Bryan J. Smith
b.j.smith at ieee.org
Sun Jul 25 18:41:05 CDT 2004
Ralph Green Jr. wrote:
> I am having a problem with tar that is probably just my
> misunderstanding of how it works. I want to tar up two different
> directories, in different parts of a backup script. There is a -A
> option which says it will append to an existing archive.
It appends existing _tarballs_ to an archive.
To add new _paths/files_ you need to use "r" instead, e.g.,
$ tar rvf old.tar newpath1/ newpath2/...
> So, I create the archive with the first tar command and then add to
> it. The resulting tar archive is bad.
Shouldn't be bad. If you don't give it a tarball to add, then the
original tarball stays the same (or should).
> A transcript of a simply test is shown below. The files listed in the
> archive are all from the first directory. The error is where the files
> from the second directory would show up. Any ideas?
Yeah, tar is just telling you it can't add new files because none are
tarballs. They must already be tarballs.
Pass multiple paths to a _single_ command, e.g.,
$ tar -cf /home/rgreen/test.tar ~/filters ~/bpp
BTW, small note, you can_not_ use A/r if you are attempting to add to a
_compressed_ archive.
I don't like the idea of compressed archives anyway, and use something
like "afio" which compresses files _before_ they go into the archive.
Far more recoverable in the case of an error.
I sure wish the IEEE/XOpen Austin group would have addressed a standard
way of doing this with the new "pax" POSIX 2001 ustar format replacement
utility for cpio/tar. But they didn't. They could have made it
_modular_ so you could use _any_ compressor, but they didn't.
--
Linux Enthusiasts call me anti-Linux.
Windows Enthusisats call me anti-Microsoft.
They both must be correct because I have over a
decade of experience with both in mission critical
environments, resulting in a bigotry dedicated to
mitigating risk and focusing on technologies ...
not products or vendors
--------------------------------------------------
Bryan J. Smith, E.I. b.j.smith at ieee.org
More information about the Discuss
mailing list