e3801486cf3726b78344144aa45ab99ce65e0f01
[debian/amanda] / man / amanda-taperscan.7
1 '\" t
2 .\"     Title: amanda-taperscan
3 .\"    Author: Dustin J. Mitchell <dustin@zmanda.com>
4 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
5 .\"      Date: 02/21/2012
6 .\"    Manual: Miscellanea
7 .\"    Source: Amanda 3.3.1
8 .\"  Language: English
9 .\"
10 .TH "AMANDA\-TAPERSCAN" "7" "02/21/2012" "Amanda 3\&.3\&.1" "Miscellanea"
11 .\" -----------------------------------------------------------------
12 .\" * Define some portability stuff
13 .\" -----------------------------------------------------------------
14 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15 .\" http://bugs.debian.org/507673
16 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18 .ie \n(.g .ds Aq \(aq
19 .el       .ds Aq '
20 .\" -----------------------------------------------------------------
21 .\" * set default formatting
22 .\" -----------------------------------------------------------------
23 .\" disable hyphenation
24 .nh
25 .\" disable justification (adjust text to left margin only)
26 .ad l
27 .\" -----------------------------------------------------------------
28 .\" * MAIN CONTENT STARTS HERE *
29 .\" -----------------------------------------------------------------
30 .SH "NAME"
31 amanda-taperscan \- Amanda Taperscan Algorithms
32 .SH "DESCRIPTION"
33 .PP
34 Amanda uses a
35 \fItaperscan algorithm\fR
36 to select volumes on which to store dumps\&. Historically Amanda has provided only one, fairly complex taperscan algorithm, but this algorithm did not suit the needs of all users\&. Now Amanda offers a wide array of algorithms to suit varied needs\&. Adding new algorithms is not difficult\&.
37 .PP
38 The taperscan algorithm is specified with the
39 \fBtaperscan\fR
40 parameter, which has a default value of
41 \fBtraditional\fR\&.
42 .PP
43 Taperscan algorithms are implemented as perl packages with the prefix
44 Amanda::Taper::Scan::\&. See the perl documentation for
45 Amanda::Taper::Scan
46 for more information\&.
47 .SH "DEFINING A TAPERSCAN"
48 .PP
49 An taperscan is defined in
50 \fBamanda.conf\fR(5)
51 as follows:
52 .sp
53 .nf
54 define taperscan $taperscan_name {
55    comment "$comment"
56    plugin "$pluginname"
57    property "$PROPERTY_NAME" "$PROPERTY_VALUE"
58    \&.\&.\&.
59 }
60 .fi
61 and then referenced in the global section as
62 .sp
63 .nf
64   taperscan "$taperscan_name"
65 .fi
66 .PP
67 Taperscan properties, like Amanda configuration parameters, are insensitive to case, and
68 \-
69 (dash) and
70 _
71 (underscore) may be used interchangeably\&.
72 .PP
73 See the individual plugin documentation below for properties applicable to each plugin\&.
74 .SH "TAPERSCAN ALGORITHMS"
75 .PP
76 In general, these algorithms will only select reusable volumes\&. These are volumes which are listed in the
77 \fBtapelist\fR(5)
78 with the
79 \fIreuse\fR
80 flag, and which are not among the
81 \fItapecycle\-1\fR
82 most recent volumes in the list\&. Put another way, reusable volumes do not contain data that must be retained\&. Note that if fewer than
83 \fItapecycle\-1\fR
84 volumes have been written then there are no reusable volumes\&. Newly labeled volumes (volumes that have been labeled with
85 \fBamlabel\fR
86 but never used) are considered reusable\&.
87 .PP
88 Many of these algorithms look for the oldest reusable volume\&. In most cases, this is the best volume to overwrite, as the data it contains is older than that on any other volume\&. If there are no reusable volumes, then there is no oldest reusable volume\&.
89 .SS "traditional"
90 .PP
91 This algorithm duplicates Amanda\*(Aqs historical behavior, and it operates in two stages\&.
92 .PP
93 First, if there is an oldest reusable volume and if the changer supports "fast" searches, then the algorithm uses the changer to search for that volume\&. Newly labeled volumes are not considered when calculating the oldest reusable volume\&. Consequently, this taperscan algorithm prefers volumes which have been used before to newly\-labeled volumes when a fast\-searchable changer is in use\&.
94 .PP
95 Second, if there is no oldest reusable volume, or if that volume is not available in the changer, then the algorithm begins a sequential scan of the changer, starting at the current slot\&. It selects the first suitable volume it finds: a reusable volume (perhaps newly\-labeled) or, if
96 \fBautolabel\fR
97 includes
98 \fBempty\fR, a blank volume\&. Even across multiple invocations (when
99 \fIruntapes > 1\fR), it will not return the same slot twice\&.
100 .if n \{\
101 .sp
102 .\}
103 .RS 4
104 .it 1 an-trap
105 .nr an-no-space-flag 1
106 .nr an-break-flag 1
107 .br
108 .ps +1
109 \fBNote\fR
110 .ps -1
111 .br
112 This algorithm shows an undue preference for volumes already containing
113 data, by omitting newly\-labeled volumes from its first stage\&.  Historically,
114 many Amanda changer scripts were not fast\-searchable (including
115 \fIchg\-multi\fR, \fIchg\-disk\fR and, if
116 \fIhavereader=0\fR, \fIchg\-zd\-mtx\fR), and thus
117 skipped the first stage, allowing new volumes to find their way into the tape
118 cycle\&.  New changers are almost all fast\-searchable, so both stages of the
119 algorithm are used and new tapes may be unexpectedly excluded\&.  If this causes
120 an undesirable change in behavior, consider one of the other taperscan
121 algorithms\&..sp .5v
122 .RE
123 .SS "oldest"
124 .PP
125 This algorithm works with the Changer API (see
126 \fBamanda-changers\fR(7)), using the inventory returned by the changer to locate the oldest acceptable volume available\&. Note that this will not work with changers that do not support inventory (old changers)\&. The algorithms scans unknown slots only if no known usable volume is found in the inventory\&.
127 .PP
128 An acceptable volume is a reusable volume, a new labeled volume or an unlabeled volume that can be labeled according to
129 \fBautolabel\fR\&. Note that changers do not always know the contents of every slot \- for example, a tape with an unknown barcode will not be considered usable\&.
130 .PP
131 Use
132 \fBamtape CONF inventory\fR
133 to see the changer\*(Aqs inventory, and use
134 \fBamtape CONF update\fR
135 to update it\&.
136 .SS "lexical"
137 .PP
138 This algorithm also works with the Changer API, using the inventory to determine the acceptable volumes; it then uses the volume which follows the last\-used volume in lexical order\&. For volume labels containing leading zeros, e\&.g\&.,
139 CORP\-010, this algorithm will run through the volumes in the natural order\&.
140 .PP
141 It scans unknown slots only if no usable volume is found in the inventory\&.
142 .PP
143 See
144 \fBoldest\fR, above, for a definition of acceptable volumes\&.
145 .SH "SEE ALSO"
146 .PP
147 \fBamanda\fR(8),
148 \fBamanda.conf\fR(5),
149 \fBtapelist\fR(5),
150 \fBamanda-changers\fR(7),
151 \fBamanda-interactivity\fR(7)
152 .PP
153 The Amanda Wiki:
154 : http://wiki.zmanda.com/
155 .SH "AUTHOR"
156 .PP
157 \fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&>
158 .RS 4
159 Zmanda, Inc\&. (http://www\&.zmanda\&.com)
160 .RE