- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Sudo with rsync
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
Discussions
Discussions
Discussions
Forums
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
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
тАО07-02-2018 07:05 AM
тАО07-02-2018 07:05 AM
Sudo with rsync
Hi,
I am using rsync with sudo on HPUX.
Rsync version:
rsync version 3.0.9 protocol version 30
HPUX Version:
#uname -a
HP-UX SrvName B.11.31 U ia64 0697013711 unlimited-user license
I have created one user "rsynccheck" with sudo rights and he is executing below command.
rsync command:
$rsync -zavru --rsync-path="sudo rsync" /Rsync/file_path /some/path
The command is working fine.My motive for executing above command was that it will preserve users and group of file at destination as it was in source.
The problem is that it is keeping the group at destination as source but changing owner of file to "rsynccheck".
I want to keep same owner and group at source and destination.Please help
Regards
- Tags:
- rsync
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-03-2018 10:02 AM
тАО07-03-2018 10:02 AM
Re: Sudo with rsync
From the man page for rsync:
-o, --owner This option causes rsync to set the owner of the destination file to be the same as the source file, but only if the receiving rsync is being run as the super-user (see also the --super and --fake-super options). Without this option, the owner of new and/or transferred files are set to the invoking user on the receiving side. The preservation of ownership will associate matching names by default, but may fall back to using the ID number in some circumstances (see also the --numeric-ids option for a full discussion).
There is no easy way to make the source and destination systems use the same owner. Ownership is a number in the passwd file and unless the passwd files on both machines have been intelligently synchronized, the owner that you see at the destination may not be the same.
To check this, run this command on both source and destination systems:
grep ^rsynccheck /etc/passwd
The 3rd field (after the second : character) is the number that represents the owner. HP-UX translates this number with commands like ls -l into usernames from the passwd file. To see how HP-UX sees ownership, use the command: ls -ln
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-04-2018 05:56 AM
тАО07-04-2018 05:56 AM
Re: Sudo with rsync
Hi,
Thanks for the reply.
I am first testing this on my local server,then i will test this between Two Servers(both HPUX).So the destination path also exists on same server.
I have run below command from "rsynccheck" user
rsync -zavruo rsynccheck --rsync-path='sudo rsync' /some/destination/path
but after executing above command also only i can see group of source folder same as destination folder..User on destination is stiill "rsynccheck"(User which is executing the command) and is different from source.Please suggest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-04-2018 06:37 PM
тАО07-04-2018 06:37 PM
Re: Sudo with rsync
rsync -zavruo rsynccheck --rsync-path='sudo rsync' /some/destination/path
It is not clear what you are doing. Is the rsyncchecek parameter a file or directory? This command will fail if you are not cd'd into a path where just the unqualified path is given.
For the remote system, it should be:
userName@remoteHost:/some/destination/path
It is not clear at all what you are expecting. The userName at the destnation will *only* match the source when the passwd file uses the same UID (user ID number). And similarly, the GID (group ID number) must match. The GID numbers are found in /etc/group. If either /etc/passwd or /etc/group do not match, then you'll have to run as super user as mentioned in the man page.
It would really help if you pasted the ll command for the source and destination files.
Don't use: ll rsynccheck
Show the fullpath like this: ll -d $PWD/rsynccheck
on both machines..
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2018 01:31 AM
тАО07-05-2018 01:31 AM
Re: Sudo with rsync
Hi,
.Both source("rsynccheck" folder)and destination path(/some/destination/path)
existes on same server."rsyncchecek" is a file which i am trying to copy using rsync.Also i am executing above command using "rsyncchecek" user.
Hope this clears your confusion.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-05-2018 01:36 AM
тАО07-05-2018 01:36 AM
Re: Sudo with rsync
Hi,
There is a typo error in my above Post.User is "rsynccheck" and also folder name is also "rsynccheck"
I am executing this command to copy one file from source to destination on same server.
Thanks for the support provided till now!!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-06-2018 06:56 PM
тАО07-06-2018 06:56 PM
Re: Sudo with rsync
It would really help if you copy/paste the ll command results for the source and destination files.
Don't use: ll rsynccheck
Show the fullpath like this: ll -d $PWD/rsynccheck
at both locations..
Bill Hassell, sysadmin