LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 03-04-2008, 10:21 PM   #1
Maeltor
Member
 
Registered: Mar 2004
Location: Boise
Distribution: CentOS 5
Posts: 69

Rep: Reputation: 15
Frustrating RSYNC issue setting up CentOS mirror


Ok, I am having the most absolute horribly frustrating time setting up a CentOS mirror.
I have initiated an rsync script and cron job however and the script works, however its writing the files with seemingly random owners and groups.

Code:
#!/bin/sh

# please adjust
lock=~/`basename ${0}`.lock

if [ -f ${lock} ]; then
       # This ensure script didn't die w/o removing lock
       # Ex: power failure
       [ -d /proc/`cat ${lock}` ] && exit 0
fi

clean () {
       rm -fr ${lock}
}

trap clean 0

rsync -aqHz --delete --delay-updates --exclude '/2*' --exclude '/3*' us-msync.centos.org::CentOS /var/www/centos
I am running the script as root, why is it NOT writing the files as root to my local server?
It is writing the files as mysql:mysql sometimes and jeremyv:nagioscmd othertimes. Any ideas?

I am running CentOS 5.0

Last edited by Maeltor; 03-04-2008 at 10:22 PM.
 
Old 03-04-2008, 11:06 PM   #2
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
The '-a' implies '-o', which preserves owner. If you want '-a' except for '-o', you can do
Code:
rsync -a --no-o ...
 
Old 03-04-2008, 11:48 PM   #3
Maeltor
Member
 
Registered: Mar 2004
Location: Boise
Distribution: CentOS 5
Posts: 69

Original Poster
Rep: Reputation: 15
Ok so to understand this a bit better.
Is it trying to preserve the owner and group from the master rsync server? If that is the case how is it pulling user/group that I have on my local system (like mysql and jeremyv)? Is that because it is preserving by userid and groupid?

If so I will modify my script to read

Code:
rsync -aqHz --no-o --no-g --delete --delay-updates --exclude '/2*' --exclude '/3*' us-msync.centos.org::CentOS /var/www/centos
If I am understanding this correctly, that will write the files to my local server as root:root right?
 
Old 03-04-2008, 11:52 PM   #4
Maeltor
Member
 
Registered: Mar 2004
Location: Boise
Distribution: CentOS 5
Posts: 69

Original Poster
Rep: Reputation: 15
It would appear that worked, looks like it is writing the files as root:root now.

Thanks
 
Old 03-05-2008, 12:30 AM   #5
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Ownership is preserved by owner name. When the name isn't present on the target, the uid (number) is preserved instead. That uid may already correspond to some user on the target, which can lead to unexpected results. This behavior can be changed with --numeric-ids.

Last edited by Berhanie; 03-05-2008 at 12:37 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DISCUSSION: Using rsync to mirror data between servers david_ross LinuxAnswers Discussion 8 03-29-2012 02:37 AM
Frustrating compilation issue PatrickNew Linux - Software 5 02-13-2008 03:51 PM
LXer: Mirror Your Web Site With rsync LXer Syndicated Linux News 0 05-21-2006 07:21 PM
Rsync to mirror data for backup - having difficulties tapanga Linux - Newbie 1 05-17-2004 06:45 PM
www mirror: is dnotify / rsync my best bet? GuitsBoy Linux - Software 2 01-27-2004 08:34 PM


All times are GMT -5. The time now is 01:07 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration