tar -u adds all files regardless of mod date

Tim Kientzle kientzle at freebsd.org
Wed Sep 21 21:22:16 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:

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

Hrrmph.  Looks like the pathname rewrite (stripping leading '/')
is getting done too late, so that the wrong filenames are
being compared.

Please check that the following does work (without the leading '/'):

    tar -cf foo.tar usr/dir_a/dir_b
    tar -uvf foo.tar usr/dir_a/dir_b

Assuming that works correctly, I know where the mistake is;
I'll have a tentative patch for you to try in a couple of hours.

Tim Kientzle

More information about the freebsd-questions mailing list