Link to home
Start Free TrialLog in
Avatar of rares_dumitrescu
rares_dumitrescu

asked on

how to preserve file permissions/ownership - rsync

Hi guys,

I have a dilemma.

I have a big storage server, around 5.5 tb raid6. I have it NFS mounted to a front end server, and i have several customers backing up data there. The server runs centos 5.4 - 64 bit, and most customers use rsync to backup their data over.

Now i have a request that file/folder permissions and ownership to be retained. I don't know how to work this out, hence when transferring the data from the local to the remote server, will result in the copied files having ownership of the username that is on the remote server.

Can you give me some insights on how to work this out ?

Thanks in advance
Avatar of arober11
arober11
Flag of United Kingdom of Great Britain and Northern Ireland image


Hi

A "-p" argument will replicate the permissions, see: http://www.manpagez.com/man/1/rsync/

Replicating Owner and Group attributes is a little harder. For a start the local users and groups will have to defined on your server (/etc/passwd and /etc/group, with the same uid and gid),  secondly the rsync will have to be performed as root, which raises a few security issues.
Avatar of rares_dumitrescu
rares_dumitrescu

ASKER

i cannot run it as root, for security issues, and regarding defining them on the remote server that would not be an option, and i would have multiple users backing up data and overlapping.

is there any other way i could preserve the owner/group ? i mean not necessarily preserve it on the remote, but to be able to restore ownerships on data restore.
Not without root access. Their only option would be to create local archives e.g. taf, and SFTP them over to your NAS.
is there any way i could save the permissions on the folders to a file ? and then restore those permissions somehow from the same file, when i restore the complete backup?
ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
the save state works. i have tested it, but the restore doesn't.

i have tested this, and when i call the restore nothing happens.

what i have done to see if it actually works, i chowned and chmodded several files after i saved the previous state, and then i tried to apply state. did not work.

any help is appreciated, as i am not quite well going with perl.
Did you run the restore as root?
yes ofcourse.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks guys.