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

Minimal Rsync Idea

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
   rsync --times --verbose \
       $RSYNC_HOST::$RSYNC_DIR/project/trace/ \
       $TO/project/trace/ >> $LOGFILE 2>&1
   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

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.

Reply to: