X-Git-Url: https://git.grml.org/?p=grml-live.git;a=blobdiff_plain;f=examples%2Fmkdebmirror;fp=examples%2Fmkdebmirror;h=c8e255a8493f0f7ac11f8b3f005f2d2b04337f58;hp=0000000000000000000000000000000000000000;hb=357aeccc20289a8b31a4d50ac718b9acc4e65c22;hpb=02f2d2167c9489eb19d068b8265858515b5416e9 diff --git a/examples/mkdebmirror b/examples/mkdebmirror new file mode 100644 index 0000000..c8e255a --- /dev/null +++ b/examples/mkdebmirror @@ -0,0 +1,43 @@ +#!/bin/sh +# $Id: mkdebmirror 4018 2006-09-25 12:13:17Z lange $ +# Thomas Lange, lange@informatik.uni-koeln.de, (c) 2001-2005 +# create partitial debian mirror using command debmirror(1) and rsync + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - +rsync_disks() { + # get the boot disks + rsync --delete -av $2::debian/dists/$1/main/disks-$arch $destdir/debian/dists/$1/main/ +} +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - +update_from() { + # update local mirror from a host + host=$1 + defopt="$allopt --host=$host --dist=$dist" + echo "------------------ create mirror for debian ------------------" + debmirror --getcontents $destdir/debian $defopt +} + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# main program +# here you have to adjust the hostnames of the mirror and the names of the distributions +debug="$@" +arch=i386 +dist=etch +# dist=etch,etch-proposed-updates +destdir=/var/www/debian_mirror +allopt="$debug --ignore-missing-release --ignore-release-gpg --passive --nosource --arch=$arch --ignore=disks-$arch/" + +# first sync from a mirror near to you! +# please ask the mirror admin(s) for permission before downloading +# several GB of data! +update_from ftp.de.debian.org + +# since this mirror is not always up to date, sync the rest from an official mirror +# update_from ftp.de.debian.org + +# even one should not mirror the security site, but I will do it. +echo "------------------ create mirror for debian-security ------------------" +debmirror $destdir/debian-security $allopt --host=security.debian.org -r debian-security --section main,contrib,non-free -d etch/updates + +# get installation disk images via rsync +#rsync_disks etch ftp2.de.debian.org