Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Jan 2018 09:55:53 -0700
From:      "Dale Scott" <dalescott@shaw.ca>
To:        <freebsd-questions@freebsd.org>
Subject:   freebsd tar fails but not gtar ?!?
Message-ID:  <00d101d399eb$318a7c40$949f74c0$@shaw.ca>

next in thread | raw e-mail | index | archive | help

Hi all.  I noticed the tar backup of my WordPress content directory is
failing. It may be coincidental that the filenames tar is failing are longer
than 99-characters, which was reportedly a failing of the “old” tar. I
installed gtar from packages and it completes successfully. Adding –posix to
the tar command doesn’t help. It’s been suggested that locale on the system
isn’t set correctly. Does this sound familiar to anyone?

 

Fwiw, the failing long filenames were auto-generated by WordPress. I was
writing a blog post in Chrome on a Windows system and found I could paste
images from the Windows clipboard directly into the WordPress editor.

 

Thanks,

Dale

 

dale@whizzer:~ % uname -a

FreeBSD whizzer.dalescott.net 11.1-RELEASE-p4 FreeBSD 11.1-RELEASE-p4 #0:
Tue Nov 14 06:12:40 UTC 2017
root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64

 

First, basic native tar on FreeBSD 11.1

 

dale@whizzer:~ % sudo tar cf
/backup/yyyy-mm-dd/webapps/wordpress_wp-content.tar
/usr/local/www/wordpress/wp-content

tar: Removing leading '/' from member names

: Can't translate pathname
'usr/local/www/wordpress/wp-content/uploads/2018/01/2018-01-25-14_52_00-fix-
Removed-leave-and-join-chapter-web-pages-by-vishdha-·-Pull-Request-111-·-.
png' to UTF-8: Can't translate pathname
'usr/local/www/wordpress/wp-content/uploads/2018/01/2018-01-25-14_52_00-fix-
Removed-leave-and-join-chapter-web-pages-by-vishdha-·-Pull-Request-111-·--
150x150.png' to UTF-8: Can't translate pathname
'usr/local/www/wordpress/wp-content/uploads/2018/01/2018-01-25-14_52_00-fix-
Removed-leave-and-join-chapter-web-pages-by-vishdha-·-Pull-Request-111-·--
300x201.png' to UTF-8: Can't translate pathname
'usr/local/www/wordpress/wp-content/uploads/2018/01/2018-01-25-14_52_00-fix-
Removed-leave-and-join-chapter-web-pages-by-vishdha-·-Pull-Request-111-·--
768x514.png' to UTF-8: Can't translate pathname
'usr/local/www/wordpress/wp-content/uploads/2018/01/2018-01-25-14_52_00-fix-
Removed-leave-and-join-chapter-web-pages-by-vishdha-·-Pull-Request-111-·--
1024x686.png' to UTF-8: Can't translate pathname
'usr/local/www/wordpress/wp-content/uploads/2018/01/2018-01-25-14_52_00-fix-
Removed-leave-and-join-chapter-web-pages-by-vishdha-·-Pull-Request-111-·--
100x100.png' to UTF-8dale@whizzer:~ % dale@whizzer:~ %

 

Next, native freebsd tar with --posix flag (google found some Linux posts
that indicated pre-posix tar had a filename length limit)

 

dale@whizzer:~ % sudo tar cf --posix
/backup/yyyy-mm-dd/webapps/wordpress_wp-content.tar
/usr/local/www/wordpress/wp-content

tar: Removing leading '/' from member names

: Can't translate pathname
'usr/local/www/wordpress/wp-content/uploads/2018/01/2018-01-25-14_52_00-fix-
Removed-leave-and-join-chapter-web-pages-by-vishdha-·-Pull-Request-111-·-.
png' to UTF-8: Can't translate pathname
'usr/local/www/wordpress/wp-content/uploads/2018/01/2018-01-25-14_52_00-fix-
Removed-leave-and-join-chapter-web-pages-by-vishdha-·-Pull-Request-111-·--
150x150.png' to UTF-8: Can't translate pathname
'usr/local/www/wordpress/wp-content/uploads/2018/01/2018-01-25-14_52_00-fix-
Removed-leave-and-join-chapter-web-pages-by-vishdha-·-Pull-Request-111-·--
300x201.png' to UTF-8: Can't translate pathname
'usr/local/www/wordpress/wp-content/uploads/2018/01/2018-01-25-14_52_00-fix-
Removed-leave-and-join-chapter-web-pages-by-vishdha-·-Pull-Request-111-·--
768x514.png' to UTF-8: Can't translate pathname
'usr/local/www/wordpress/wp-content/uploads/2018/01/2018-01-25-14_52_00-fix-
Removed-leave-and-join-chapter-web-pages-by-vishdha-·-Pull-Request-111-·--
1024x686.png' to UTF-8: Can't translate pathname
'usr/local/www/wordpress/wp-content/uploads/2018/01/2018-01-25-14_52_00-fix-
Removed-leave-and-join-chapter-web-pages-by-vishdha-·-Pull-Request-111-·--
100x100.png' to UTF-8dale@whizzer:~ %

 

Finally with gtar

 

dale@whizzer:~ % gtar --version

tar (GNU tar) 1.29

Copyright (C) 2015 Free Software Foundation, Inc.

License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>.

This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.

 

Written by John Gilmore and Jay Fenlason.

dale@whizzer:~ % sudo gtar cf
/backup/yyyy-mm-dd/webapps/wordpress_wp-content.tar
/usr/local/www/wordpress/wp-content

gtar: Removing leading `/' from member names dale@whizzer:~ % ls
/backup/yyyy-mm-dd/webapps/wordpress_wp-content.tar

/backup/yyyy-mm-dd/webapps/wordpress_wp-content.tar

dale@whizzer:~ % ls -lh /backup/yyyy-mm-dd/webapps/wordpress_wp-content.tar

-rw-r--r--  1 root  wheel   505M Jan 28 19:46
/backup/yyyy-mm-dd/webapps/wordpress_wp-content.tar

dale@whizzer:~ %

 

Output of locale:

 

dale@whizzer:~ % sudo locale

LANG=

LC_CTYPE="C"

LC_COLLATE="C"

LC_TIME="C"

LC_NUMERIC="C"

LC_MONETARY="C"

LC_MESSAGES="C"

LC_ALL=

dale@whizzer:~ %

 

 

 

---

Dale R. Scott, P.Eng.

Web: http://www.dalescott.net <http://www.dalescott.net/>; 

 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?00d101d399eb$318a7c40$949f74c0$>