cancel
Showing results for 
Search instead for 
Did you mean: 

copy files with ACL entries

Camel_1
Valued Contributor

copy files with ACL entries

Hi there,

The server have lots of files with ACL entries, I need to copy these files to other server and preserve the ACL entries. I tried various options (cpio / tar / scp / cp) are not working.

Any other suggestions?

Thanks,

Simon
6 REPLIES
Steven Schweda
Honored Contributor

Re: copy files with ACL entries

> The server [...] other server [...]

Not very detailed descriptions of anything.

uname -a

Have you looked at fbackup/frecover? (Or,
perhaps, GNU "tar"?)
Camel_1
Valued Contributor

Re: copy files with ACL entries

Steven,

for example, this file has the following ACL setting (by getacl command)

# getacl /home/abc/mytest
# file: /home/abc/mytest
# owner: ual
# group: ual
user::rwx
user:train1:r--
user:train2:r-x
user:train3:r-x
user:train4:r--
group::r-x
class:r-x
other:r-x

I want to copy this file from Server A to Server B and preserve the ACL setting. Both servers have the same user setup.

I tried differnt commands (cp / scp /tar / cpio), I can copy the files but not the ACL setting.

Thanks.
Jose Mosquera
Honored Contributor

Re: copy files with ACL entries

Hi,

You need preserve these attributes from source to target, please review -p (preserve) option at rcp or cp commands.

Also you can encapsulate requested files in source host using tar command, the untar at target host. The files keeps whole source's atributes. UID/GID must be equals en both hosts to keep source ownership.

Rgds.
Camel_1
Valued Contributor

Re: copy files with ACL entries

thanks all replied. I found out I can use rsync with --acl option to copy the ACL between servers.
Camel_1
Valued Contributor

Re: copy files with ACL entries

rysnc -A --acls
Steven Schweda
Honored Contributor

Re: copy files with ACL entries

> for example, this file has the following
> ACL [...]

Yes, I know what an ACL is.

> I want to copy this file from Server A to
> Server B [...]

I also understand what "copy" means, but I
still don't know what "Server A" or "Server
B" is. Which part of "uname -a" was unclear?

> I tried differnt commands (cp / scp /tar /
> cpio), [...]

I understood this the first time you said it.

> Have you looked at fbackup/frecover? [...]

I'm still wondering. Do you ever _answer_
questions, or do you only ask the same ones,
over and over?

> [...] I can use rsync [...]

Nice sledgehammer. I'm not sure that your
flies justify its use.