|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Rsync - Preserve owner/group with different UID/GID
Dear Folks :-) I want to rsync some files between some servers and preserve files owner and group (not UID or GID), in some machines UID and GID are differents, for example: a) In the rsync server: Code:
# stat vbseo.php File: `vbseo.php' Size: 26758 Blocks: 56 IO Block: 4096 regular file Device: 804h/2052d Inode: 21971712 Links: 1 Access: (0644/-rw-r--r--) Uid: (10002/ user1) Gid: (10001/ psacln) Access: 2006-10-09 18:30:59.000000000 +0200 Modify: 2006-10-09 19:12:48.000000000 +0200 Change: 2006-10-09 19:12:48.000000000 +0200 # grep psacln /etc/group psacln:x:10001: b) In the rsync clients: Code:
# stat vbseo.php File: `vbseo.php' Size: 26758 Blocks: 56 IO Block: 4096 regular file Device: 803h/2051d Inode: 37421492 Links: 1 Access: (0644/-rw-r--r--) Uid: (10002/ user1) Gid: (10001/ UNKNOWN) Access: 2007-11-30 10:46:59.000000000 +0100 Modify: 2006-10-09 19:12:48.000000000 +0200 Change: 2007-11-30 10:46:59.000000000 +0100 # grep psacln /etc/group psacln:x:2524: In the case of UID/GID are the same between machines there isn't problems.. but when don't match there are problems. I have tried several rsync options like "--owner", "--group", "--numeric-ids", "--super", etc.. but getting the same result.. is there anyway to make this with rsync? I have a similar solution with tar+ssh but I want to use Rsync: Code:
tar cpzf - /source --ignore-failed-read --ignore-zeros | ssh root@192.168.x.x -p22 "cd /destination; tar --same-owner -xzf -" Regards, -- Santi Saez |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
The mapping of username to UID (and groupname to GID) stays within the server. The only way to get the names in sync is to keep the UIDs in sync or to chown the files after doing the copy sorry.
|
| Sponsored Links | ||
|
![]() |
| Tags |
| rsync, tar command |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Setting group and owner with mkdir? | moose123 | UNIX for Dummies Questions & Answers | 1 | 07-20-2011 10:34 AM |
| preserve timestamp of symlinks using rsync | KiranKumarKarre | Shell Programming and Scripting | 1 | 06-18-2009 10:24 AM |
| automatically change owner and group | borderblaster | Shell Programming and Scripting | 1 | 04-24-2009 07:11 AM |
| permission, owner and group | pascalbout | Shell Programming and Scripting | 2 | 01-14-2006 10:47 AM |
| owner and group in Linux | lapnguyen | UNIX for Dummies Questions & Answers | 1 | 07-16-2002 10:55 AM |
|
|