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

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

Revision 1.9, Wed Mar 3 18:24:47 2010 UTC (14 years, 2 months ago) by andrew
Branch: MAIN
Changes since 1.8: +2 -2 lines

note what is Already running for less confusion

#!/bin/sh
# $RedRiver: MirrorOpenBSD,v 1.8 2010/01/05 19:43:16 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 $0 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
#SERVER=rsync://mirror.rit.edu/OpenBSD/
SERVER=rsync://mirror.planetunix.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 /[23].?/" \
	-f "exclude /4.[01234]/" \
	-f "exclude /4.[5789]/packages/" \
	${SERVER} ${OBT_DIR_FTP}/${OBT_BASENAME}