Help - Search - Members - Calendar
Full Version: preserve the ownerships and permssions with NAS BACKUP.
The Planet Forums > System Administration > Server Hardware
shrinivasd
Hi,
We have Linux server with NAS backup in the CP of orbittheplanet.We are using the RSYNC command for taking the backup of system to NAS.but the ownerships and permissions of file are not getting preserved.
How can i take the backup with preserve of ownerships and permissions on NAS?


Details of RSYNC command:
rsync -avz --delete src dst
src is my server path
dst is NAS BACKUP path.

Waiting for +ve reply.

Thanks,
Shrinivas.
Blue|Fusion
You can't preserve the ownership of indivudual files on the NAS because it does not have the same UNIX users as your server. If you really needed to preserve file permissions, create a tarball backup with any compression you want.

tar -jxvpf /mnt/nas/backup.tar.bz2 /path/to/stuff

Something like that will preserve permissions and write the tarball right to NAS (although will be slow, so if you can do it locally and the move it over, it would be better).
shrinivasd
Hi,
Thanks for reply.But is it possible with RSYNC command ?


Thanks
shrinivas.
Jeff
QUOTE (shrinivasd @ Dec 28 2006, 06:47 AM) *
Hi,
Thanks for reply.But is it possible with RSYNC command ?
Thanks
shrinivas.

I have not figured out how to preserve file ownership using rsync to the nas, because as blue fusion says, the users don't exist on the nas server.

So if you do incremental backup, you'd have to re-apply file ownership in the event of a restore. Possibly someone has scripted something to help with this ???

Or you can tar everything up into a tar archive which of course when unpacked, preserves all the permissions and ownerships, but that means no more incremental backup.
BlueFusion
If you REALLY wanted to get down and dirty with some shell scripting, it would be possible for you to get all permissions on each file/directory with ls -l and sed and some other customizing of the output to what you want. Each file can be checked for permissions, the owners and permissions for each file saved to a text file and then everything rsync'ed over. To get everything back how it was, you would have to pretty much reverse the whole process. Sync the data over, have a script to parse the permissions/owners text file and then chown/chmod each file/dir based off of that.

On all honesty, thought, that may take just as long, if not longer, than the tarball method. Don't know for sure though. Perhaps in the future I'll try it out.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.