File: README.debian

package info (click to toggle)
mirror 2.9-13slink15
  • links: PTS
  • area: main
  • in suites: slink
  • size: 588 kB
  • ctags: 303
  • sloc: perl: 5,881; makefile: 131; sh: 56
file content (110 lines) | stat: -rw-r--r-- 3,437 bytes parent folder | download
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110


	   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 <lmjm@doc.ic.ac.uk>,
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/doc/examples/mirror.

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.

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.

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 use
to mirror the Linux HOWTOs and FAQ for the doc-linux package:

		  ----------------------------------------

# parameter file for mirror
#
# written by Dirk Eddelbuettel <edd@debian.org>

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$)
	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 <edd@debian.org>

# 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".
 

Dirk Eddelbuettel  
<edd@debian.org>