LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 09: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 09:22 PM.
 
Old 03-04-2008, 10: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, 10: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, 10: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-04-2008, 11:30 PM   #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-04-2008 at 11:37 PM.
 
  


Reply



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 01:37 AM
Frustrating compilation issue PatrickNew Linux - Software 5 02-13-2008 02:51 PM
LXer: Mirror Your Web Site With rsync LXer Syndicated Linux News 0 05-21-2006 06:21 PM
Rsync to mirror data for backup - having difficulties tapanga Linux - Newbie 1 05-17-2004 05:45 PM
www mirror: is dnotify / rsync my best bet? GuitsBoy Linux - Software 2 01-27-2004 07:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:20 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration