Red HatThis forum is for the discussion of Red Hat Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Can someone please help me with a command or way to copy a very large parent folder /data from 'server_old' to 'server_new' while preserving the data ownership (UID/GID) and file permissions? I tried running:
Code:
scp -rp /data/* root@server_new:/data/
Sadly the command above is not working for me and only copying everything over as root:root and not james:finance and other sub folders as jamesersonal. Is there a way to use tar, scp, rsync, or anything that will copy the permissions exactly?
The ownership and permissions should be preserved using tar if the UID exists on the remote backup host.
One thing nice about tar is you can use the tee command to save a tar backup as well, killing two birds with one stone. Handy if you have an external HD to backup to.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.