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.