[BACK]Return to MirrorOpenBSD CVS log [TXT][DIR] Up to [local] / openbsd / OpenBSDTorrents

File: [local] / openbsd / OpenBSDTorrents / MirrorOpenBSD (download)

Revision 1.6, Tue Oct 20 19:05:58 2009 UTC (14 years, 7 months ago) by andrew
Branch: MAIN
Changes since 1.5: +25 -1 lines

use rsync again, it seems more reliable

#!/bin/sh
# $RedRiver: MirrorOpenBSD,v 1.4 2007/10/01 20:17:23 andrew Exp $

. /etc/OpenBSDTorrents.conf

cd ${OBT_DIR_HOME}
PIDFILE=${OBT_DIR_HOME}/run/mirror.pid

if [ -e ${PIDFILE} ]; then
	PID=`head -1 ${PIDFILE}`
	kill -0 ${PID} 2> /dev/null
	if [ $? -eq 0 ]; then
		echo Already running
		exit 1
	fi
fi
echo $$ > ${PIDFILE}

SERVER=rsync://ftp3.usa.openbsd.org/ftp/
#SERVER=rsync://ftp5.usa.openbsd.org/ftp/
#SERVER=rsync://openbsd.mirrors.tds.net/OpenBSD
#SERVER=rsync://openbsd.mirror.frontiernet.net/OpenBSD

#	--dry-run \
rsync -a \
	--delete --delete-excluded \
	--verbose=1 --log-format="%t [%p] %o %f %l" \
	-f "exclude .*" \
	-f "exclude ls-lR.gz" \
	-f "exclude /OpenBGPD/" \
	-f "exclude /OpenNTPD/" \
	-f "exclude /OpenSSH/" \
	-f "exclude /cvs/" \
	-f "exclude /src/" \
	-f "exclude /distfiles/" \
	-f "exclude /patches/" \
	-f "exclude /snapshots/packages/" \
	-f "exclude /2.?/" \
	-f "exclude /3.?/" \
	-f "exclude /4.[01234]/" \
	-f "exclude /4.7/packages/" \
	${SERVER} ${OBT_DIR_FTP}/${OBT_BASENAME}