Release notes for the Debian GNU/Linux "mirror" package The html documentation for "mirror" is very complete, please read it if you are new to mirror. As it is distributed by its author Lee McLoughlin , mirror can simply be run from the the directory it is installed in. Several small examples are given in the source package for "mirror" and can be found in /usr/share/doc/mirror/examples. The Debian GNU/Linux package installs mirror as a user command. The default values can be set in the file /etc/mirror/mirror.defaults but mirror has sensible defaults set in its perl source code. A patch for efficient mirroring using ls-lR.patch files, written by Ian Maclaine-cross (i.maclaine-cross@unsw.edu.au), has been applied to the Debian package starting with release 2.9-6. See /usr/share/doc/mirror/applied-patches for consolidated patches and /usr/share/doc/mirror/html/mirror-lslR.html for additional information and /usr/share/doc/mirror/examples/iml for example parameter files. Ian and I feel that Lee, as per the copyright, prefers us to distribute the patches separately, which we do even though it is a little cumbersome. If anyone can get hold of Lee, and make him change his mind, please let us know. In order to actually run mirror, some more values are required. I prefer to store all the information relevant for a internet host in a file bearing the name of that host. These package file are stored in /etc/mirror/package. As an example, here is the file /etc/mirror/packages/sunsite.unc.edu that I used to use to mirror the Linux HOWTOs and FAQ for the doc-linux{,-text,-html} package I used to maintain: ---------------------------------------- # parameter file for mirror # # written by Dirk Eddelbuettel package=HOWTO comment=Linux HOWTOs site=sunsite.unc.edu remote_dir=/pub/Linux/docs/HOWTO local_dir=/usr/local/mirror/sunsite/HOWTO mail_to=edd compress_patt=. compress_excl=(COPYRIGHT|README|\.gz$|\.z$) local_ignore= exclude_patt=(\.cap|\.html|other-formats) package=Linux-FAQ comment=Linux FAQ site=sunsite.unc.edu remote_dir=/pub/Linux/docs/faqs/linux-faq local_dir=/usr/local/mirror/sunsite/faqs mail_to=edd compress_patt=. compress_excl=(COPYRIGHT|README|\.gz$|\.z$) exclude_patt=(\.cap|\.html|old) ---------------------------------------- Then, the command mirror /etc/mirror/packages/sunsite.unc.edu can be issued at the command line (or from a crontab file) to start the mirror. I use the mirror-master command to have two mirror sessions run at the same time, rather than sequentially. The file /etc/mirror/mm/sunsite.unc.edu is as follows: ---------------------------------------- # parameter file for mirror-master # # written by Dirk Eddelbuettel # change into this 'home' directory for mirroring home=/usr/local/mirror # call 'mirror' as follows; add a '-n' for testing/debugging mirror=mirror -p$package /etc/mirror/packages/$site > /usr/local/mirror/logs/$site:$package 2>&1 # mirror these if last mirroring was at least 20h ago sunsite.unc.edu:HOWTO 20 20 sunsite.unc.edu:Linux-FAQ 20 20 ---------------------------------------- is then used by the command mirror-master /etc/mirror/mm/sunsite.unc.edu It helps to know a little perl to make use of the regular expressions. If you are unfamiliar with perl, note that a "(A|B|C)" construct describes the alternatives A, B and C. As a dot "." is a meta character that matches any character, it has to be escaped with "\". "^" and "$" denote beginning and end of an expression, "$" can be handy to exclude directories. "[" and "]" are used to specify a range. But please consult perlre(1) for the full scoop. It is usually a good idea to add the test switch -n and log the result of a test run of mirror before going "into production". As an example of how the ls-lR patch can be used, consider the following parameter file for Debian's non-US server. This could then be placed into a file /etc/mirror/packages/nonus.debian.org. ---------------------------------------- # -*- sh -*- # Debian GNU/Linux "mirror" package, maintained by # # Example of mirroring the non-us site of Debian with the patch.ls-lR feature package=defaults site=nonus.debian.org remote_dir=/debian-non-US/ local_dir=/var/spool/mirror/debian/debian-non-US/ user=edd group=edd package=patch # skip=true local_ignore= recursive=false do_deletes=false name_mappings=s:ls-lR:remote_ls-lR: get_patt=ls-lR.patch.gz package=files comment=Mirror of nonus.debian.org:/pub/debian-non-US/binary-i386 recursive=true get_size_change=true # ls_lR_file=/debian-non-US/ls-lR.patch.gz # ls_lR_file=/pub/systems/linux/debian/ls-lR.times # local_ls_lR_file=/var/spool/mirror/debian/debian-non-US/remote_ls-lR # mail me the results mail_to=edd # compress_patt=\.*Contents$ compress_patt+|Packages(-Master)?$ compress_patt+||ls-lR|contents|md5sums|Maintainers|msdos-names$ # exclude_patt+|Incoming/|source/ exclude_patt+|(Contents|binary|Packages-Master)-(alpha|arm|hurd-i386|sparc|m68k|powerpc) exclude_patt+|project/ # do_deletes=true ---------------------------------------- Here is matching mirror-master parameter file (which could be stored accordingly as /etc/mirror/mm/nonus.debian.org). ---------------------------------------- # parameter file for mirror-master # # written by Dirk Eddelbuettel # change into this 'home' directory for mirroring home=/var/log/mirror # call 'mirror' as follows; add a '-n' for testing/debugging mirror=mirror -p$package /etc/mirror/packages/$site > $site:$package # max of 1 mirror run in order to use ls-lR patch max=1 # mirror these if last mirroring was at least 20h ago nonus.debian.org:defaults 20 20 nonus.debian.org:patch 20 20 nonus.debian.org:files 20 20 ---------------------------------------- Written by Dirk Eddelbuettel author of the Debian mirror package and maintainer 1995-2000. Please let me know if you have comments or suggestions. Ian Maclaine-cross maintainer 2001-xxxx.