- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- rcp : preserving file ownership
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 02:10 AM
06-13-2002 02:10 AM
I'm executing rcp as a root user from a src machine hostA to destination machine hostB.
I'm copying a user's file i.e ken_lee whom exist on both hostA and hostB.The file to be copied, file1.cc does not exist on the destination.
hostA
-r-xr-xr-x 1 ken_lee wmt .... file1.cc
I had invoked rcp from hostA as follows:
#rcp -i /dir1/file1.cc hostB:/dir1/
whereby user ken_lee also owns dir1 in hostB.
However, the -p option does not seem to preserve the source ownership.
Upon copying, contents of dir1 in hostB is as follows:
hostA
-r-xr-xr-x 1 root wmt .... file1.cc
The original group is preserved, but not the owner.
I could do a chown to change the ownership manually, or a chown -R if there're many files to be copied without having the ownership preserved.
But does anyone know of method of preserving the ownership during remote copy of rcp?
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 02:16 AM
06-13-2002 02:16 AM
Re: rcp : preserving file ownership
Is this user's UID is same in both the BOXes. If not please make it same and try.. This just a thought
Best of luck
Shahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 02:16 AM
06-13-2002 02:16 AM
Re: rcp : preserving file ownership
The rcp(1) manpage says (for the -p switch):
--
Preserve (duplicate) modification times and modes (permissions) of source files, ignoring the current setting of the umask file creation mode mask.
--
I'm afraid there is no way to preserve owner/group by using the rcp command only.
It should be possible, though, to change the destination files (on the other server) by using remsh commands.
Bye,
Rik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 03:06 AM
06-13-2002 03:06 AM
Re: rcp : preserving file ownership
Is it 0.
I assume it is zero.
So when you have copied the file using the rcp -p option it has preserved the file owner as 0,copied to host A and there check for the passwd file for uid 0 and took it as root.
rcp with the -p option should preserve the ownership.
Please check it out.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 03:31 AM
06-13-2002 03:31 AM
Re: rcp : preserving file ownership
UID of ken_lee in hostB is not 0, but 17219 on both host machines.
Any ideas?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 03:52 AM
06-13-2002 03:52 AM
SolutionBut you can do something like that:
tar cf - source_dir | remsh remote_host "cd remote_dir; tar xvpf -"
And check this thread (same thing with cpio):
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xfb5bc5ea0230d411ade80090279cd0f9,00.html
Hope this helps,
Hartmut
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 04:20 AM
06-13-2002 04:20 AM
Re: rcp : preserving file ownership
Preserving ownership will only work if both machines are the same for group / group number and user / user number.
Files do not carry the ower/group name but the owner number and group number and translate them to user name and group name when required.
HTH
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 04:32 AM
06-13-2002 04:32 AM
Re: rcp : preserving file ownership
Try "rdist"
http://support1.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&docId=200000048206948
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2002 05:53 AM
06-13-2002 05:53 AM
Re: rcp : preserving file ownership
# tar cvf - /.../ | remsh dest tar xvf -
I'm pritty sure there is another example in man tar
Tim