freebsd tar fails but not gtar ?!?

Dale Scott dalescott at shaw.ca
Tue Jan 30 16:56:00 UTC 2018


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 at 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 at amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC  amd64

 

First, basic native tar on FreeBSD 11.1

 

dale at 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 at whizzer:~ % dale at whizzer:~ %

 

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

 

dale at 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 at whizzer:~ %

 

Finally with gtar

 

dale at 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 at 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 at whizzer:~ % ls
/backup/yyyy-mm-dd/webapps/wordpress_wp-content.tar

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

dale at 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 at whizzer:~ %

 

Output of locale:

 

dale at 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 at whizzer:~ %

 

 

 

---

Dale R. Scott, P.Eng.

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

 



More information about the freebsd-questions mailing list