LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-19-2015, 12:12 AM   #1
spcz
LQ Newbie
 
Registered: Jun 2015
Posts: 2

Rep: Reputation: Disabled
Question Can tar archive files with extended attributes


Environment:
Centos 6.6 X86_64; File system:ext4

Question: Can tar archive files with extended attributes?

for example:
# chattr +a /tmp/logs/softa.log
-----a-------e- /tmp/logs/softa.log

I try to archive it by the follow
# tar --xattrs -Jpcvf /tmp/logs.tar.xz /tmp/logs

then I try to restore by the follow
# tar -Jxvf /tmp/logs.tar.xz -C /tmp/logs_b
# tar --xattrs -Jpxvf /tmp/logs.tar.xz -C /tmp/logs_a

but it didn't have +a
-------------e- /tmp/logs_a/tmp/logs/softa.log
-------------e- /tmp/logs_b/tmp/logs/softa.log

Thanks in advance
 
Old 06-19-2015, 12:42 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,838

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
http://www.cyberciti.biz/faq/linux-t...inux-contexts/
probably you need to run as root to be able to restore everything

Last edited by pan64; 06-19-2015 at 12:43 AM.
 
Old 06-19-2015, 02:36 AM   #3
spcz
LQ Newbie
 
Registered: Jun 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hi pan64

I run as root, I follow your link, but it still fails.

tar --selinux --acls --xattrs -cvf file.tar /var/www
tar -xvf file.tar

I also test facl with -acl, the acl is ok
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Extract from `tar` archive as ordered in --files-from zx_ Linux - Newbie 6 02-04-2012 09:08 AM
[SOLVED] Archive :: TAR :: How do I recompile to allow large files? cin_ Slackware 4 12-05-2010 03:33 PM
adding files to tar archive pooks Linux - Newbie 3 04-02-2009 06:08 AM
show biggest files in tar archive? ahz10 Linux - Software 3 11-04-2005 03:48 PM
How to list the files in my tar.bz2 archive ??? merlin23 Linux - Newbie 13 12-14-2004 08:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:41 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration