Which optins should I use to back up files

Hi,
I want to back up many files using gnu tar. I used -p to reserve the
user previlidge property. Do you mind to tell me that is there any other
special options should I take to make a better tar file? Thanks !

Regards!
Bo
struggle [ So, 04 November 2007 05:05 ] [ ID #1861870 ]

Re: Which optins should I use to back up files

Bo Yang wrote:
>
> I want to back up many files using gnu tar. I used -p to reserve the
> user previlidge property. Do you mind to tell me that is there any other
> special options should I take to make a better tar file? Thanks !

[GNU tar]

"--create" and "--verify" is adequate. If you want a POSIX compliant
archive "--format=posix".

You need "-p" only when you _extract_ files and you are not user root.

--
Best regards | Be nice to America or they'll bring democracy to
Cyrus | your country.
Cyrus Kriticos [ So, 04 November 2007 09:24 ] [ ID #1861871 ]

Re: Which optins should I use to back up files

Cyrus Kriticos :
> Bo Yang wrote:
>>
>> I want to back up many files using gnu tar. I used -p to reserve the
>> user previlidge property. Do you mind to tell me that is there any
>> other special options should I take to make a better tar file? Thanks !
>
> [GNU tar]
>
> "--create" and "--verify" is adequate. If you want a POSIX compliant
> archive "--format=posix".
>
> You need "-p" only when you _extract_ files and you are not user root.
>

Thank you very much!

Regards!
Bo
struggle [ Mo, 05 November 2007 14:58 ] [ ID #1862392 ]

Re: Which optins should I use to back up files

Bo Yang wrote:
> Hi,
> I want to back up many files using gnu tar. I used -p to reserve the
> user previlidge property. Do you mind to tell me that is there any other
> special options should I take to make a better tar file? Thanks !
>
> Regards!
> Bo

Note that tar doesn't by default backup ext[234] attributes, nor
any extended attributes (including selinux labels). Try using
"--xattrs" to back that stuff up as well.

-Wayne
wayne [ Mo, 05 November 2007 17:47 ] [ ID #1862396 ]

Re: Which optins should I use to back up files

Wayne wrote:
> Bo Yang wrote:
>> Hi,
>> I want to back up many files using gnu tar. I used -p to reserve the
>> user previlidge property. Do you mind to tell me that is there any other
>> special options should I take to make a better tar file? Thanks !
>>
>> Regards!
>> Bo
>
> Note that tar doesn't by default backup ext[234] attributes, nor
> any extended attributes (including selinux labels). Try using
> "--xattrs" to back that stuff up as well.
>
> -Wayne

Actually, a quick check of Gnu tar 1.15.1 shows it doesn't backup/restore
ACLs and EAs correctly. You should use "star" instead:

$ star -cv f=dir.tar --acl --xattr --xfflags artype=exustar dir

Which backups up everything in directory dir, including ACLs, EAs, and
any ext[234] attributes, to the archive "dir.tar". To restore:

$ star -xvp --acl --xattr --xfflags f=dir.tar

-Wayne
wayne [ Mo, 05 November 2007 23:26 ] [ ID #1862416 ]
Linux » comp.unix.shell » Which optins should I use to back up files

Vorheriges Thema: Shell function doesn't return correct value over 255?
Nächstes Thema: Announcement: bashcritic