I've setup a new mirror (almost finished) but I have a few questions. I am running the first sync as a single command right now, sync'ed weekly until I get a few questions answered.
Currently, my command is: rsync -aqzH --delete --delay-updates us-msync.centos.org::CentOS /var/ www/centos
I plan on just allowing http for now, and I'm connected via multi- homed DS3's so bandwidth is not a HUGE problem. I am not limited but might have to if the link becomes very heavily used.
My questions are: If I am to sync 2-4 times a day, how do I setup lock files in a script? Right now i'm just using a single command (listed above). I assume you will most likely tell me to connect to a Tier 1 server to sync from instead of a master server right? Secondly, if I were to say drop down to only version 5, what is the best way to do that as well?
Thanks, Josh
Le mardi 4 mars 2008, Maeltor a écrit :
My questions are: If I am to sync 2-4 times a day, how do I setup lock files in a script? Right now i'm just using a single command (listed above). I assume you will most likely tell me to connect to a Tier 1 server to sync from instead of a master server right?
Here an extract of one of my own script:
######################## #!/bin/bash
# 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 ....
clean
########################
Otherwise, to manage all rsync I am writing an application: http://mmm.zarb.org, but I still have finish it (especially doc)... The result can be seen here: http://distrib-coffee.ipsl.jussieu.fr/mmm
Regards.
Forgive me for being somewhat green here
I have a few more questions. Does this script look reasonable? Is there anything I need to adjust to use the lock files you posted? I want to restrict my mirror to Ver 5 to save on space and bandwidth (and since realistically it probably won't be used by many people other than me).
Please have a look at this script:
#!/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="/usr/bin/rsync -aqHz --delete --delay-updates"
# this should be auto-selected, but the centos mirror script doesn't # support selection by a specific protocol (i.e., rsync) #mirror=mirror.stanford.edu::mirrors/centos #mirror=centos.cs.wisc.edu::centos #mirror=mirrors.usc.edu::centos mirror=us-msync.centos.org::CentOS
ver=5 archlist="i386 x86_64" baselist="os updates" local=/var/www/centos
for arch in $archlist do for base in $baselist do remote=$mirror/$ver/$base/$arch/ $rsync $remote $local/$ver/$base/$arch/ done done
On Mar 4, 2008, at 11:57 AM, Olivier Thauvin wrote:
Le mardi 4 mars 2008, Maeltor a écrit :
My questions are: If I am to sync 2-4 times a day, how do I setup lock files in a script? Right now i'm just using a single command (listed above). I assume you will most likely tell me to connect to a Tier 1 server to sync from instead of a master server right?
Here an extract of one of my own script:
######################## #!/bin/bash
# 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 ....
clean
########################
Otherwise, to manage all rsync I am writing an application: http://mmm.zarb.org, but I still have finish it (especially doc)... The result can be seen here: http://distrib-coffee.ipsl.jussieu.fr/mmm
Regards.
I would just do this:
$rsync --exclude '/2*' --exclude '/3*' --exclude '/4*' $mirror $local
Also... if you're only mirroring 5, and only really intend it to be for your personal use... maybe you'd just be better off syncing from a tier 2 mirror and keeping it private?
Maeltor wrote:
Forgive me for being somewhat green here
I have a few more questions. Does this script look reasonable? Is there anything I need to adjust to use the lock files you posted? I want to restrict my mirror to Ver 5 to save on space and bandwidth (and since realistically it probably won't be used by many people other than me).
Please have a look at this script:
ver=5 archlist="i386 x86_64" baselist="os updates" local=/var/www/centos
for arch in $archlist do for base in $baselist do remote=$mirror/$ver/$base/$arch/ $rsync $remote $local/$ver/$base/$arch/ done done