#!/bin/sh #assumes $1 contains the name of the repo to mirror SYNC_HOME="/home/neotuli/mirror.neotuli.net/arch" # use protocol 27 #SYNC_SERVER="mirror.cs.vt.edu::archlinux/" #SYNC_SERVER="mirrors.easynews.com::mirrors/linux/archlinux/" # use protocol 29 #SYNC_SERVER="ibiblio.org::pub/linux/distributions/archlinux/" SYNC_SERVER="rsync.archlinux.org::ftp/" SYNC_LOCK=${SYNC_HOME}/.${1}.lck [ -f $SYNC_LOCK ] && echo "error: ${SYNC_HOME}/${1} is locked" 1>&2 && exit 1 touch $SYNC_LOCK # use this one for mirrors using protocol < 29 #rsync -avz --delete ${SYNC_SERVER}${1} ${SYNC_HOME} # # bandwidth saver because of file rename heuristics, needs protocol 29 rsync -avz --delete-after --fuzzy ${SYNC_SERVER}${1} ${SYNC_HOME} rm -f $SYNC_LOCK exit 0