Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Feb 2018 19:31:29 -0000 (UTC)
From:      Christian Weisgerber <naddy@mips.inka.de>
To:        freebsd-questions@freebsd.org
Subject:   Re: freebsd tar fails but not gtar ?!?
Message-ID:  <slrnp7c3gh.29cu.naddy@lorvorc.mips.inka.de>
References:  <00d101d399eb$318a7c40$949f74c0$@shaw.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2018-01-30, "Dale Scott" <dalescott@shaw.ca> wrote:

> Hi all.  I noticed the tar backup of my WordPress content directory is
> failing.

How is it failing?  The "Can't translate pathname" messages you
quote are warnings, not errors.

> It?s been suggested that locale on the system
> isn?t set correctly. Does this sound familiar to anyone?

Well, when I take a file with UTF-8-encoded non-ASCII characters
in its name and tar it up in the POSIX locale, then I get the same
warning.  Clearly tar is trying to normalize path name encodings
in some way.  Unfortunately this is not documented.  My best guess
is that it tries to iconv(3) path names from the current locale
encoding to UTF-8.  If the path names are have an invalid encoding
in the current locale, iconv(3) fails, prompting the warning.

You can simply ignore the warnings.  If you extract the archive
under the same conditions as those when you created it, the path
names will be just fine.

Or you can make sure that the character encoding in your locale
setting matches those of the file names you are backing up.  Most
likely something like LC_CTYPE=en_US.UTF-8 will do.  If you don't
understand what I'm talking about, you might want to read up on
those topics.

> Next, native freebsd tar with --posix flag

That switches the archive format from the default ustar to pax,
says the man page, but you're not looking at an archive format
limitation.

> (google found some Linux posts that indicated pre-posix tar had
> a filename length limit)

Unless you are using a time machine to post from the 1980s, "old"
pre-POSIX tar is utterly irrelevant.

-- 
Christian "naddy" Weisgerber                          naddy@mips.inka.de



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?slrnp7c3gh.29cu.naddy>