230657fa9ff744cd87aa08ba233c669f1d1bec40
[debian/amanda] / man / amanda-changers.7
1 '\" t
2 .\"     Title: amanda-changers
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\-CHANGERS" "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-changers \- Configuring and Using Amanda Changers
32 .SH "DESCRIPTION"
33 .PP
34 Amanda uses changers to arbitrate access to devices (\fBamanda-devices\fR(7)) and data volumes\&. Changers provide an abstraction of tape robots, but are used to manage non\-tape media, too\&. Amanda communicates with changers through the Changer API\&. This manpage contains a
35 \fIuser\-level\fR
36 overview of the API, and does not address details that are only of concern to developers\&. For that purpose, consult the Amanda source code and http://wiki\&.zmanda\&.com\&.
37 .SH "TRANSITION"
38 .PP
39 The Amanda Changer API is in transition from version 1\&.0 \- driven by shell scripts invoked for each changer operation \- to version 2\&.0, composed of perl objects that can manage parallel access to multiple devices and other complexity\&. At this point, all Amanda programs use the new Changer API directly, although 1\&.0 changer scripts are still fully supported via
40 chg\-compat\&.
41 .PP
42 The Changer API strives to treat all changers identically, so that Amanda\*(Aqs behavior is independent of the changer in use\&. However, some parts of Amanda operate differently depending on whether a changer can efficiently search for a volume with a given label\&. This distinction is really only apparent with tape libraries: those with barcode readers can quickly find a desired tape, while those without may fall back to an inefficient scan of each volume\&. The capability to perform quick searches is called "fast\-search", and each changer is annotated below to indicate its support\&.
43 .SH "SPECIFYING CHANGERS"
44 .PP
45 Changer specifications are strings like
46 chg\-disk:/my/vtapes\&. The
47 chg\-
48 prefix serves to differentiate changers from devices (see
49 \fBamanda-devices\fR(7))\&. The next portion (disk, in this case) identifies the particular changer driver to use, and everything that follows the
50 :
51 is interpreted by the driver\&. Note that the
52 :
53 character is required, even when nothing follows it\&. This is an easy way to distinguish new changer specifications from old\&.
54 .PP
55 A name which does not match this pattern, but which matches an old changer script (e\&.g\&.,
56 chg\-zd\-mtx), invokes the backward\-compatibility changer driver as e\&.g\&.,
57 chg\-compat:chg\-zd\-mtx\&. If the name does not match an old changer, then it is treated as an Amanda device, and is wrapped by the single\-device changer, e\&.g\&.,
58 chg\-single:tape:/dev/rmt/0\&.
59 .PP
60 Changers which require additional parameters can also be described in
61 \fBamanda.conf\fR(5)
62 with "changer" sections\&. Such a changer defininition creates a changer "alias", in this case named
63 \fIhp\-robot\fR, which can then be named where an application expects a changer \- for example, the target of the
64 \fBamvault\fR
65 command or in a global
66 \fBtpchanger\fR
67 parameter\&.
68 .SS "CONFIGURATION"
69 .PP
70 The preferred method of specifying configuration for a changer is as a "changer" section in
71 \fBamanda.conf\fR(5)\&. The
72 \fItapedev\fR
73 parameter then indicates, by name, the changer that will be used by default by most Amanda programs\&. For example:
74 .sp
75 .nf
76 define changer hp\-robot {
77     tapedev "chg\-robot:/dev/sg1"
78     property "tape\-device" "0=tape:/dev/nst0"
79     property append "tape\-device" "1=tape:/dev/nst1"
80     device\-property "BLOCK_SIZE" "512k"
81 }
82 # \&.\&.\&.
83 tapedev "hp\-robot"
84 .fi
85 .PP
86 Several changer drivers accept
87 \fIchanger properties\fR
88 which control the behavior of the changer\&. These properties must be specified in a changer definition, as in the
89 \fIhp\-robot\fR
90 example, above\&.
91 .PP
92 Devices, too, can take properties to control their behavior (see
93 \fBamanda-devices\fR(7))\&. Device properties can come from four places: implicit device properties (from tapetype parameters), global device properties (from global
94 \fIdevice\-property\fR
95 parameters), properties in device definitions, and properties in changer definitions\&. Properties are applied in this order, with later properties taking priority\&.
96 .PP
97 There are only three implicit properties:
98 \fIMAX_VOLUME_USAGE\fR
99 is set based on the tapetype
100 \fIlength\fR
101 parameter,
102 \fIREAD_BLOCK_SIZE\fR
103 is set if
104 \fIreadblocksize\fR
105 is set, and
106 \fIBLOCK_SIZE\fR
107 is set based on the
108 \fIblocksize\fR
109 parameter\&.
110 .PP
111 Global device properties always apply\&. If the changer specifies a device by alias, then device properties from the definition apply\&. If the changer is specified by an alias, then properties from that definition applied\&.
112 .SH "CHANGER DRIVERS"
113 .PP
114 This section lists the changer drivers included with Amanda, and basic instructions for using them\&. For complete How\-To information, consult the Amanda wiki at http://wiki\&.zmanda\&.com\&.
115 .SS "chg\-aggregate:changer (new)"
116 .nf
117 define changer robot0 {
118   tpchanger "chg\-robot:/dev/sg0"
119   property "tape\-device" "0=tape:/dev/rmt/0" "1=tape:/dev/rmt/1"
120 }
121 define changer robot1 {
122   tpchanger "chg\-robot:/dev/sg1"
123   property "tape\-device" "0=tape:/dev/rmt/2" "1=tape:/dev/rmt/3"
124 }
125 define changer single {
126   tpchanger "chg\-single:/dev/rmt/4"
127 }
128 define changer aggregate {
129   tpchanger "chg\-aggregate:{robot0,robot1,single}"
130   property "state\-filename" "/etc/amanda/CONF/aggregate\&.state"
131
132 }
133 tpchanger "aggregate"
134 .fi
135 .PP
136 This changer driver allow to use two or more changers or standalone drive in sequence\&.
137 .SS "chg\-disk:VTAPEROOT (new)"
138 .nf
139 tpchanger "chg\-disk:/var/mnt/vtapes"
140 property "num\-slot" "10"
141 property "auto\-create\-slot" "yes"
142 property "removable" "yes"
143 property "mount" "yes"
144 property "umount" "yes"
145 property "umount\-lockfile" "/etc/amanda/conf/vtapes\-lock"
146 property "umount\-idle" "1"
147 .fi
148 .PP
149 This changer driver replaces the old
150 \fBchg\-disk\fR, supporting parallel access to vtapes stored in directories named
151 slotN
152 in the directory specified after
153 chg\-disk:\&. It does so by creating numbered "drives" so that simultaneous processes can access distinct slots\&. This changer is fast\-search capable\&.
154 .PP
155 The current slot can be accessed using the device name
156 file:VTAPEROOT\&. This is useful for the
157 \fBamrestore\fR(8)
158 command line\&.
159 .SS "Properties"
160 .PP
161 AUTO\-CREATE\-SLOT
162 .RS 4
163
164 If a slotN directory in the range 1 to NUM\-SLOT does not already exist, and this property is true, then the changer will create the directory\&.
165 .RE
166 .PP
167 MOUNT
168 .RS 4
169
170 If this property is true, the changer try to mount the removable disk if nothing is mounted\&. The system must be configured to allow the amanda user to mount it\&.
171 .RE
172 .PP
173 NUM\-SLOT
174 .RS 4
175
176 The minimum number of slots in the changer, where the first slot is slot1\&.  If additional slot directories exist, they will also be used\&.
177 .RE
178 .PP
179 REMOVABLE
180 .RS 4
181
182 If this property is true, then the changer will verify that the changer
183 directory (e\&.g\&., /var/mnt/vtapes) is on a different
184 filesystem from its parent directory (e\&.g\&., /var/mnt)\&.
185 This is useful for removable disks, as it will prevent Amanda from creating
186 slot directories when the removable disk is not mounted\&.
187 .RE
188 .PP
189 UMOUNT
190 .RS 4
191
192 If this property is true, the changer try to umount the removable disk when it exit\&. The system must be configured to allow the amanda user to umount it\&.
193 .RE
194 .PP
195 UMOUNT\-LOCKFILE
196 .RS 4
197
198 If UMOUNT is set, it require a lockfile outside of the mount point to prevent race\&.
199 .RE
200 .PP
201 UMOUNT\-IDLE
202 .RS 4
203
204 If set, the changer try to umount the removable disk when it is not in use\&. The umount\-idle value is a delay in second to wait before doing the umount\&. A value >= 1 is required to prevent useless mount/umount\&.
205 .RE
206 .SS "chg\-disk (old)"
207 .nf
208 tapedev "file:/u01/vtapes"
209 tpchanger "chg\-disk"
210 changerfile "chg\-disk\&.conf"     # optional file
211 .fi
212 .PP
213 This changer script supports sequential access to vtapes stored in directories named
214 slotN
215 in the directory specified by the
216 \fItapedev\fR
217 parameter\&. The configuration file parameter is:
218 .sp
219 .nf
220 LASTSLOT=number    # The number of slots, default to tapecycle setting\&.
221 .fi
222 .PP
223 This changer is not fast\-search capable\&.
224 .SS "chg\-multi:DEVICE\-LIST"
225 .nf
226 tpchanger "chg\-multi:{/dev/nst0,/dev/nst1,/dev/nst2}"
227 changerfile "chg\-multi\-state"
228 .fi
229 .PP
230 This script simply round\-robins a number of distinct device names, as specified in the
231 \fItpchanger\fR
232 setting\&. It is useful when all volumes for a configuration have different device names \-\- for example, if you have many standalone drive\&. The
233 \fIchangerfile\fR
234 must exist; it is used to save the state file\&.
235 .PP
236 The child devices are specified using the same syntax as for the RAIT device (see
237 \fBamanda-changers\fR(7))\&. The range specification can be especially useful here:
238 .sp
239 .nf
240 tpchanger "chg\-multi:s3:mycompany\-backups/tape\-{001\&.\&.100}"
241 .fi
242 .PP
243 This changer is not fast\-search capable\&.
244 .SS "Properties"
245 .PP
246 FIRST\-SLOT
247 .RS 4
248
249 This property gives the number of the first slot\&. The default value is "1"\&.
250 .RE
251 .SS "Special Operations"
252 .PP
253 A number of special operations are available for
254 \fBchg\-multi\fR
255 via
256 \fBamtape\fR(8)
257 subcommands\&.
258 .PP
259 The
260 \fBreset\fR
261 subcommand will change the current slot to the first available slot, but does not erase any stored state maintained by the changer\&.
262 .PP
263 The
264 \fBeject\fR
265 subcommand will eject the volume in the given drive
266 .PP
267 The
268 \fBclean\fR
269 subcommand is not yet implemented\&.
270 .PP
271 The
272 \fBupdate\fR
273 subcommand instructs the changer to update its state database\&. Given no arguments, the changer will scan all available slots, loading each tape and reading its label\&. Especially for large libraries, this can take a long time\&. If only a few slots have changed, they can be listed on the command line:
274 .sp
275 .nf
276 amtape CONFIG update 1\-3,9
277 .fi
278 In this case, the changer will only scan the stated slots\&. Finally, the changer will not scan at all if it is given the tape label for the slot:
279 .sp
280 .nf
281 amtape CONFIG update 2=DailySet\-028
282 .fi
283 In this case, the changer updates its state to indicate that
284 DailySet\-028
285 is in slot 2, without trying to load the tape\&.
286 .sp
287 .nf
288 amtape CONFIG update 1\-3,9=
289 .fi
290 In this case, the changer marks the stated slots as an unknown state\&.
291 .SS "chg\-multi (old)"
292 .nf
293 tpchanger "chg\-multi"
294 changerfile "chg\-multi\-state"
295 .fi
296 .PP
297 This script simply round\-robins a number of distinct device names, as specified in its configuration file\&. It is useful when all volumes for a configuration have different device names \-\- for example, with S3 devices\&. The
298 \fIchangerfile\fR
299 need not exist; it is used as a prefix for filenames of state files\&.
300 .PP
301 The configuration file has simple lines with a parameter and its value separated by a space\&. The # character introduces a comment\&. The configuration parameters are:
302 .PP
303 multieject
304 .RS 4
305 If this is 1, use an \*(Aqmt
306 offline\*(Aq command to change to the next tape, or multiple such commands for
307 skipping several tapes at a time\&.
308 .RE
309 .PP
310 needeject
311 .RS 4
312 This option is incompatible with
313 \*(Aqmultieject\*(Aq\&. This should be 1 for changers accessed through several virtual
314 tape devices, when the changer needs the current tape to be ejected before
315 changing to another device\&.
316 .RE
317 .PP
318 gravity
319 .RS 4
320 Set this to 1 if the
321 changer/stacker is unable to loop back to the first tape after unloading the
322 last one, or if you don\*(Aqt want amanda to go through the tape stack looking for
323 the exact tape it wants instead of using the first acceptable one\&.
324 .RE
325 .PP
326 slot X
327 .RS 4
328 The configuration file should list
329 as many \*(Aqslot X\*(Aq statements as the number of slots supported by the changer or
330 the number of separate tape drives used\&.
331 .RE
332 .PP
333 This changer is not fast\-search capable\&.
334 .SS "chg\-manual"
335 .nf
336 tpchanger "chg\-manual"
337 changerfile "chg\-manual\&.conf"
338 .fi
339 .PP
340 This script simply provides distinct device names in a round\-robin fashion, as specified in its configuration file\&. It is useful when all volumes for a configuration have different device names \-\- for example, with S3 devices\&. The configuration file parameters are (as listed in the script):
341 .sp
342 .nf
343 resend_mail=900       # resend mail every __ seconds
344 timeout_mail=604800   # time out after this many seconds (default 7 days)
345 request="[type]"      # How to request a new tape (default "tty_email")
346   request="tty"       # Use the tty to ask the user to change tape\&.
347                       # Can\*(Aqt be use by cron
348   request="email"     # Send an email to ask the user to change tape\&.
349   request="tty_email" # Use the tty if it exist or send an email\&.
350 .fi
351 .PP
352 This changer is not fast\-search capable\&.
353 .SS "chg\-zd\-mtx (old)"
354 .nf
355 tpchanger "chg\-zd\-mtx"
356 changerdev "/dev/sg0"         # used with \*(Aqmtx \-f\*(Aq
357 changerfile "chg\-zd\-mtx\&.conf"
358 tapedev "tape:/dev/nst0"
359 .fi
360 .PP
361 This script interfaces with a tape drive using the Zubkoff/Dandelion version of mtx\&. That\*(Aqs the version that takes a device specifier with the
362 \fB\-f\fR
363 option and has subcommands like
364 \fBstatus\fR\&. The configuration file parameters are (as listed in the script itself):
365 .sp
366 .nf
367 firstslot=?                 #### First storage slot (element)
368 lastslot=?                  #### Last storage slot (element)
369 cleanslot=\-1                #### Slot with cleaner tape \-\- default is "\-1"
370                             #### Set negative to indicate no cleaner available
371 driveslot=0                 #### Drive slot number\&.  Defaults to 0
372                             #### Use the \*(AqData Transfer Element\*(Aq you want
373 autoclean=0                 #### Set to \*(Aq1\*(Aq or greater to enable
374 autocleancount=99           #### Number of access before a clean\&.
375 havereader=0                #### If you have a barcode reader, set to 1\&.
376 offline_before_unload=0     #### Does your robot require an
377                             #### \*(Aqmt offline\*(Aq before mtx unload?
378 poll_drive_ready=NN         #### Time (seconds) between tests to see if
379                             #### the tape drive has gone ready (default: 3)\&.
380 max_drive_wait=NN           #### Maximum time (seconds) to wait for the
381                             #### tape drive to become ready (default: 120)\&.
382 initial_poll_delay=NN       #### initial delay after load before polling for
383                             #### readiness
384 slotinfofile=FILENAME       #### record slot information to this file, in
385                             #### the line\-based format "SLOT LABEL\en"
386 .fi
387 .PP
388 This changer is fast\-search capable if and only if
389 \fBhavereader\fR
390 is true\&.
391 .SS "chg\-rait:{CHILD1,CHILD2,\&.\&.}"
392 .nf
393 define changer vtape {
394     tpchanger "chg\-disk:/path/to/vtape"
395 }
396 define changer robot {
397     tpchanger "chg\-robot:/dev/sg0"
398     tapedev "tape:/dev/nst0"
399 }
400 tpchanger "chg\-rait:{vtape,robot}"
401 .fi
402 .PP
403 This changer script constructs RAIT devices out of the devices provided by several "sub\-changers"\&. The sub\-changers are specified using the same shell\-like syntax as the RAIT device (see
404 \fBamanda-devices\fR(7))\&.
405 .PP
406 Chg\-rait does not require that all of the child changers have the same slot names: compound slot names are created by combining the slot names supplied by the child changers using the same shell\-like syntax\&. For example, if the child changers return slots "top", "strange", and "3", then the RAIT changer will return "{top,strange,3}"\&. This makes it possible to, for example, mirror data on tapes in slots 1\-10 to tapes in slots 11\-20 of the same robot, using two
407 \fBchg\-zd\-mtx\fR
408 child changers (and, naturally, two tape drives)\&. In this arrangement, the first slot would be named
409 {1,11}\&.
410 .PP
411 As a convenience to the user, the RAIT changer will also accept un\-braced slot names, and supply the same name to each child changer\&. Thus with a 4\-device RAIT changer, "17" is equivalent to "{17,17,17,17}"\&.
412 .PP
413 Drive names are parsed in a similar fashion, for operations that take drive names (clean and eject)\&.
414 .PP
415 This changer is fast\-search capable only if all of its child changers are fast\-search capable\&.
416 .if n \{\
417 .sp
418 .\}
419 .RS 4
420 .it 1 an-trap
421 .nr an-no-space-flag 1
422 .nr an-break-flag 1
423 .br
424 .ps +1
425 \fBNote\fR
426 .ps -1
427 .br
428 The old chg\-rait script is no longer supported nor shipped with Amanda, although the old script will continue to function via \fBchg\-compat\fR, giving users time to upgrade their configuration\&.
429 .sp .5v
430 .RE
431 .SS "chg\-null:"
432 .nf
433 tpchanger "chg\-null:"
434 .fi
435 .PP
436 This changer always provides the device "null:"\&. It is sometimes useful in conjunction with
437 \fBchg\-rait:\fR\&.
438 .SS "chg\-robot:DEVICE"
439 .nf
440 define changer robot {
441     tpchanger "chg\-robot:/dev/sg0"
442     property "tape\-device" "0=tape:/dev/rmt/0" "1=tape:/dev/rmt/1"
443     property "eject\-before\-unload" "yes"
444     property "use\-slots" "1\-5,11\-20"
445 }
446 tpchanger "robot"
447 .fi
448 .PP
449 This changer drives a robotic tape library using the operating system\*(Aqs
450 \fBmtx\fR
451 command\&. It replaces the ancient
452 \fBchg\-zd\-mtx\fR
453 script\&. The changer uses all of the information available to operate as efficiently as possible\&. Even without a barcode reader, the changer can usually load a tape immediately, without resorting to a sequential scan of many tapes\&. It is capable of sharing state across multiple Amanda configurations, avoiding conflicts and optimally tracking the contents of the library\&.
454 .PP
455 This changer does not accept a
456 \fBchangerdev\fR
457 parameter, but the
458 \fBchangerfile\fR
459 parameter can be used to specify a filename at which it should store its state\&. Ordinarily, this state is stored in a file named after the changer device under
460 \fI$localstatedir/amanda\fR, e\&.g\&.,
461 \fB/var/amanda/chg\-robot\-dev\-sg0\fR\&. There should be a single such statefile for each distinct tape library attached to the Amanda server, even if multiple Amanda configurations reference that library\&.
462 .PP
463 With a barcode reader present, it is possible for
464 \fBchg\-robot\fR
465 to track the state of the library reliably, even recognizing tapes that are removed and later re\-inserted (by remembering their barcodes)\&. Without barcodes, the changer can still remember the slot in which it last saw the tape with a particular label, although this information can become stale if the tapes are rearranged by an operator\&. In any case, the changer will never "hunt" for a tape by repeatedly loading slots and checking labels\&. If the changer\*(Aqs state is inaccurate, use the
466 \fBamtape\fR(8)
467 subcommand
468 \fBupdate\fR\&.
469 .PP
470 This changer is fast\-search capable even without a barcode reader\&. For such libraries, it is the responsibility of the operator to
471 \fBupdate\fR
472 the changer when tapes are added to or removed from the library\&.
473 .PP
474 There is a shell script in the
475 contrib/
476 directory of Amanda\*(Aqs source distribution which can help you convert a
477 \fBchg\-zd\-mtx\fR
478 configuration into a
479 \fBchg\-robot\fR
480 configuration\&. Just give it your Amanda configuration name:
481 .sp
482 .nf
483   sh contrib/convert\-zd\-mtx\-to\-robot\&.sh $config
484 .fi
485 The script can be downloaded at
486 http://github\&.com/zmanda/amanda/raw/master/contrib/convert\-zd\-mtx\-to\-robot\&.sh
487 .SS "Special Operations"
488 .PP
489 A number of special operations are available for
490 \fBchg\-robot\fR
491 via
492 \fBamtape\fR(8)
493 subcommands\&.
494 .PP
495 The
496 \fBreset\fR
497 subcommand will change the current slot to the first available slot, but does not erase any stored state maintained by the changer\&.
498 .PP
499 The
500 \fBeject\fR
501 subcommand will unload the volume in the given drive, ejecting first if the changer properties dictate\&. Note that, despite the subcommand name, the changer attempts to avoid the state where a volume has been ejected from the drive but not unloaded back to a storage slot\&.
502 .PP
503 The
504 \fBclean\fR
505 subcommand is not yet implemented\&.
506 .PP
507 The
508 \fBupdate\fR
509 subcommand instructs the changer to update its state database\&. Given no arguments, the changer will scan all available slots, loading each tape and reading its label\&. Especially for large libraries, this can take a long time\&. If only a few slots have changed, they can be listed on the command line:
510 .sp
511 .nf
512 amtape CONFIG update 1\-3,9
513 .fi
514 In this case, the changer will only scan the stated slots\&. Finally, the changer will not scan at all if it is given the tape label for the slot:
515 .sp
516 .nf
517 amtape CONFIG update 2=DailySet\-028
518 .fi
519 In this case, the changer updates its state to indicate that
520 DailySet\-028
521 is in slot 2, without trying to load the tape\&.
522 .sp
523 .nf
524 amtape CONFIG update 1\-3,9=
525 .fi
526 In this case, the changer marks the stated slots as an unknown state\&.
527 .SS "Properties"
528 .PP
529 DRIVE\-CHOICE
530 .RS 4
531
532 This property controls the algorithm used to select a drive in which to load a
533 tape\&.  If set to the default ("lru"), the changer attempts to use the least
534 recently used drive, resulting in a round\-robin behavior\&.  The "firstavail"
535 algorithm selects the first available drive, thus preferring the first drive
536 specified via the TAPE\-DEVICE property\&.
537 .RE
538 .PP
539 EJECT\-BEFORE\-UNLOAD
540 .RS 4
541
542 Set this boolean property to true if the library requires an
543 \fBoffline\fR operation be performed on the tape drive before it
544 can be unloaded\&.  If set, then \fBmt\fR will be invoked to
545 perform this operation\&.  Most libraries do not require this workaround\&.
546 .RE
547 .PP
548 EJECT\-DELAY
549 .RS 4
550
551 This is the time between ejecting a tape and unloading the volume to a storage slot, and
552 defaults to 0 seconds\&.  It is only used if EJECT\-BEFORE\-UNLOAD is true\&.  See "Timing", below\&.
553 .RE
554 .PP
555 FAST\-SEARCH
556 .RS 4
557
558 This boolean property indicates whether the changer advertises the ability to find
559 volumes without sequential scanning\&.  The traditional taperscan algorithm alters its
560 behavior based on this flag, so it is sometimes necessary to adjust it, although the
561 changer will always search for a desired tape using the most efficient means
562 available\&.  The default value is true\&.
563 .RE
564 .PP
565 IGNORE\-BARCODES
566 .RS 4
567
568 If this boolean property is true, then chg\-robot will ignore any barcode information
569 that the library provides\&.  This property is probably only useful when the library
570 returns incorrect barcodes, for example due to a malfunction in the barcode reader\&.
571 .RE
572 .PP
573 LOAD\-POLL
574 .RS 4
575 This property specifies the timing of Amanda\*(Aqs polling for the tape drive to be ready after loading a new tape\&. See "Timing", below\&.
576 .sp
577 The script "polls" by trying to open the tape device repeatedly until no error is encountered\&. The property specifies the time to wait before the first poll (D), the frequency at which to poll and retry on errors (P); and the time after which it should give up (U)\&. The format is
578 .sp
579 .nf
580 "D [poll P [until U]]"
581 .fi
582 For a simple delay with no polling, use e\&.g\&.,
583 .sp
584 .nf
585 property "load\-poll" "13s"
586 .fi
587 To delay and then poll, use e\&.g\&.,
588 .sp
589 .nf
590 property "load\-poll" "13s poll 5s"
591 .fi
592 and to add a maximum total time, use e\&.g\&.,
593 .sp
594 .nf
595 property "load\-poll" "0s poll 5s until 2m"
596 .fi
597 The default value is
598 \fB"0s poll 3s until 2m"\fR\&.
599 .RE
600 .PP
601 MTX
602 .RS 4
603
604 The path to the \*(Aqmtx\*(Aq binary\&.  The default value is defined at compile time\&.
605 .RE
606 .PP
607 STATUS\-INTERVAL
608 .RS 4
609
610 This is the minimum time between invocations of \fBmtx status\fR
611 to determine the state of the changer library\&.  The default value, 2 seconds,
612 avoids back\-to\-back status invocations but ensures that the metadata is up to
613 date\&.  For operating systems or libraries where the \fBmtx
614 status\fR takes a considerable time to complete, this value should be
615 increased\&.  See "Timing", below\&.
616 .RE
617 .PP
618 TAPE\-DEVICE
619 .RS 4
620
621 This property describes the correspondance of drive numbers in the library to
622 Amanda devices, in the format \fIDRIVE=DEVICE\fR\&.  The property
623 can be specified multiple times to describe multiple devices\&.  The device will
624 usually be a tape device name starting with \fBtape:\fR, but may
625 also refer to a device alias (see \fBamanda-devices\fR(7))\&. As
626 a shortcut, if the \fBtapedev\fR parameter is specified in the
627 changer definition, then it is assumed to be the device name for drive 0\&.
628 .RE
629 .PP
630 UNLOAD\-DELAY
631 .RS 4
632
633 This specifies the minimum time between an unload operation any any subsequent
634 operation\&.  The default value is 0 seconds\&.  See "Timing", below\&.
635 .RE
636 .PP
637 USE\-SLOTS
638 .RS 4
639
640 This property, if specifies, enumerates the slots to which this changer should
641 limit itself\&.  The slots are specified as a comma\-separated list of ranges,
642 e\&.g\&., "1\-5,11\-15,19,22"\&.  The property can be specified more than once, and
643 the resulting sets will be combined\&.  The changer will refuse to load tapes
644 not found in these slots, except for import/export purposes\&.
645 .RE
646 .SS "Timing"
647 .PP
648 Tape libraries are fickle, and in many cases will report that an operation is complete when it is still in progress\&. Chg\-robot takes several timing\-related properties to accomodate such behavior\&.
649 .PP
650 A typical sequence of operations performed during a load are: get library status, eject a tape, unload the tape back to a storage slot, load a new tape, and read the label on that tape to ensure the drive is ready\&.
651 .PP
652 On most systems, the library status check is nearly instantaneous \-\- the changer library provides its cached state to the host without initiating any robot motion\&. In order to keep its metadata up\-to\-date, chg\-robot runs this command very frequently, but this frequency can be reduced (at the cost of potentially stale metadata) by setting the STATUS\-INTERVAL property to a larger value\&.
653 .PP
654 Some tape libraries do not integrate the eject operation (performed by the embedded tape drive) with the unload operation (performed by the library robot), and can actually cause physical damage by attempting to remove the tape before the ejection is complete\&. For such changers, set the EJECT\-DELAY property to allow enough time for the eject to complete\&.
655 .PP
656 Once a tape is unloaded, if the library needs time to "quiesce" before processing another command, add that time to the UNLOAD\-DELAY parameter\&. No other operations will be performed on the library until this delay has elapsed\&.
657 .PP
658 Once a tape has been loaded, chg\-robot waits until the drive is ready before allowing Amanda to use the volume, as described for LOAD\-POLL, above\&.
659 .PP
660 Each of the times specified in these properties may be given as integers with the optional suffix
661 \fBs\fR
662 for seconds (the default) or
663 \fBm\fR
664 for minutes\&.
665 .SS "chg\-ndmp:HOST[:PORT]@SCSIDEV"
666 .nf
667     tpchanger "chg\-ndmp:filer\&.company\&.com@/dev/sg0"
668     property        "tape\-device" "0=ndmp:filer\&.company\&.com@/dev/rtape0"
669     property append "tape\-device" "1=ndmp:filer\&.company\&.com@/dev/rtape1"
670     property "use\-slots" "1\-12"
671     property "ndmp\-auth" "text"
672     property "ndmp\-username" "luke"
673     property "ndmp\-password" "leia"
674 .fi
675 .PP
676 This changer is very similar to
677 \fBchg\-robot\fR, but controls a tape changer on an NDMP server instead of a local device\&. The
678 \fBHOST\fR
679 in the
680 \fBtpchanger\fR
681 should be the hostname of the NDMP server\&. The
682 \fBPORT\fR
683 is optional\&. The
684 \fBSCSIDEV\fR
685 should specify the SCSI device on the NDMP server which controls the changer\&. The format of this parameter is implementation\-specific\&.
686 .PP
687 The appropriate authentication properties will be automatically set on any devices created by this changer\&.
688 .SS "Properties"
689 .PP
690 This changer supports all of the properties supported by
691 \fBchg\-robot\fR, although the value of
692 \fBMTX\fR
693 is ignored\&. The following properties are also recognized:
694 .PP
695 NDMP_AUTH
696 .RS 4
697
698 Authentication method to use to connect to the NDMP server\&.  One of
699 "md5" (default), "text", "none" (for an empty authentication attempt) or "void" (for
700 no authentication attempt at all)\&.
701 .RE
702 .PP
703 NDMP\-PASSWORD
704 .RS 4
705
706 The password for the NDMP server\&.
707 .RE
708 .PP
709 NDMP\-USERNAME
710 .RS 4
711
712 The username for the NDMP server\&.
713 .RE
714 .PP
715 VERBOSE
716 .RS 4
717
718 If true, enables the NDMJOB library\*(Aqs verbose (packet\-level) debugging\&.
719 .RE
720 .SS "chg\-single:DEVICE"
721 .nf
722 tpchanger "chg\-single:tape:/dev/nst0"
723 .fi
724 .PP
725 This changer is for use with standalone drive, it can work with any device\&. The device (\fBtape:/dev/nst0\fR) must be set in the tpchanger definition\&.
726 .PP
727 The
728 \fBchg\-single\fR
729 changer has no property\&.
730 .SS "Unmaintained Changers"
731 .PP
732 Amanda has many other changer scripts and programs beyond those described here (see the
733 changer\-src/
734 in the source directory), but most of these scripts are unmaintained and undocumented, and will be removed when the new changer API is fully implemented\&.
735 .SH "SEE ALSO"
736 .PP
737 \fBamanda\fR(8),
738 \fBamanda.conf\fR(5),
739 \fBamanda-devices\fR(7)
740 .PP
741 The Amanda Wiki:
742 : http://wiki.zmanda.com/
743 .SH "AUTHOR"
744 .PP
745 \fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&>
746 .RS 4
747 Zmanda, Inc\&. (http://www\&.zmanda\&.com)
748 .RE