tar -u adds all files regardless of mod date

Lowell Gilbert freebsd-questions-local at be-well.ilk.org
Fri Sep 9 11:33:48 PDT 2005


Gareth Bailey <gjbailey at gmail.com> writes:

> I have a directory I want to backup at /usr/dir_a/dir_b.
> I want to back the content of this dir to /usr/backups/dir_b
> so I tried the following:
> 
> # cd /usr/backups/dir_b
> # tar -cf dir_b.tar /usr/dir_a/dir_b
> 
> Now I have dir_b.tar which is 65MB in size.
> If i then try to update modified files by doing this:
> 
> # tar -uf dir_b.tar /usr/dir_a/dir_b
> 
> and I end up with dir_b.tar being 130MB (double size) which
> should not be the case since no files have been modified in
>  /usr/dir_a/dir_b.
> 
> I do not get this problem if I do the same in the /usr/dir_a
> directory. In the /usr/dir_a dir the tar file remains the same
> size.
> 
> I would much appreciate some input!

[This essentially adds up to doing 
 # tar -cf foo.tar $target_path
and then immediately 
 # tar -uvf foo.tar $target_path
shows an update.]

You didn't list any information about your system, so I don't even
know whether you're using the Gnu tar or the libarchive one, which 
has been standard for a few months now.

However, I'm seeing something like that on RELENG_5, with the new
tar.  It isn't happening to all files, though, and I haven't 
figured out why it's picking the files it is...


More information about the freebsd-questions mailing list