[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Minimal Rsync Idea



Martin Zobel-Helas wrote:
Hi,
On Wed Oct 03, 2007 at 18:40:16 -0400, David Bartley wrote:
I've augmented the anonftpsync script so that a minimal rsync is done on the project/trace/ directory to see if a "real" rsync is needed. The relevant addition is:

# check if we need to sync
if [[ "$TRACE_HOST" != "" ]]; then
   TRACE_FILE=$TO/project/trace/${TRACE_HOST}
   TRACE_PRE_DATE=`ls -al $TRACE_FILE`
   rsync --times --verbose \
       $RSYNC_HOST::$RSYNC_DIR/project/trace/ \
       $TO/project/trace/ >> $LOGFILE 2>&1
   TRACE_POST_DATE=`ls -al $TRACE_FILE`
   if [ "$TRACE_PRE_DATE" = "$TRACE_POST_DATE" ]; then
       LANG=C date -u > "${TO}/project/trace/${HOSTNAME}"
       echo 'Trace file for' $RSYNC_HOST::$RSYNC_DIR \
           'unchanged, not rsyncing.' >> $LOGFILE
       exit 0
   fi
fi

I've added this right before the first rsync. TRACE_HOST should be set to ftp-master.debian.org for the Debian repository. This seems like a reasonable alternative to push mirroring and this check has minimal impact on the remote server.

That is only needed for mirrors which aren't pushed. Mirrors that are
pushed will only get pushed, if something changed on
ftp-master.debian.org.
Yes, this is only useful if you aren't able to make arrangements to get the push.

Greetings
Martin


-- David



Reply to: