Current location

narf Source control manager Git

summaryrefslogtreecommitdiff
blob: 6b8b8911103176d72260f36d861751018a519229 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# $Id$ 
CURVER=`uname -r`

BASEDIR="/data/mirrors/openbsd/"
MAXRATE=100000
GETWHAT="${CURVER}/'uname -a' ${CURVER}/ports.tar.gz snapshots/i386 snapshots/ports.tar.gz"

RSYNC=/usr/bin/rsync
#RSYNCHOST="ftp.sunet.se"
RSYNCHOST="rsync.de.openbsd.org"
RSYNCPATH="pub/OpenBSD"
RSYNCOPTIONS="-4"
#RSYNCEXCLUDE="--exclude */source/*"

WGET=/usr/bin/wget
WGETHOST="ftp://ftp.sunet.se"
WGETPATH="pub/OpenBSD"
WGETEXCLUDE="${WGETPATH}/*/source,${WGETPATH}/*/*/source"
WGETCUTDIRS=4

cd $BASEDIR

for WHAT in $GETWHAT ; do
	mkdir -p `dirname $WHAT`
	pushd `dirname $WHAT` > /dev/null
	$RSYNC $RSYNCOPTIONS $RSYNCEXCLUDE --delete-excluded --delete --bwlimit=$MAXRATE -r -v "$@" rsync://$RSYNCHOST/$RSYNCPATH/$WHAT .
	#$WGET -m -np -nH -X $WGETEXCLUDE --cut-dirs=$WGETCUTDIRS --limit-rate=${MAXRATE}k "$@" $WGETHOST/$WGETPATH/$WHAT
	popd > /dev/null
done