[CentOS-mirror] New Mirror Setup Questions

Tue Mar 4 18:57:09 UTC 2008
Olivier Thauvin <nanardon at nanardon.zarb.org>

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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.centos.org/pipermail/centos-mirror/attachments/20080304/3ef5d064/attachment-0004.sig>