Imported Upstream version 3.3.3
[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: 01/10/2013
6 .\"    Manual: Miscellanea
7 .\"    Source: Amanda 3.3.3
8 .\"  Language: English
9 .\"
10 .TH "AMANDA\-CHANGERS" "7" "01/10/2013" "Amanda 3\&.3\&.3" "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 "Properties"
138 .PP
139 LOCK\-TIMEOUT
140 .RS 4
141
142 The time in seconds amanda wait to lock the statefile (default:1000)
143 .RE
144 .PP
145 STATE_FILENAME
146 .RS 4
147
148 The name of the state file (default: "$CONFIG_DIR/$changer_name\&.state"\&.
149 .RE
150 .SS "chg\-disk:VTAPEROOT (new)"
151 .nf
152 tpchanger "chg\-disk:/var/mnt/vtapes"
153 property "num\-slot" "10"
154 property "auto\-create\-slot" "yes"
155 property "removable" "yes"
156 property "mount" "yes"
157 property "umount" "yes"
158 property "umount\-lockfile" "/etc/amanda/conf/vtapes\-lock"
159 property "umount\-idle" "1"
160 .fi
161 .PP
162 This changer driver replaces the old
163 \fBchg\-disk\fR, supporting parallel access to vtapes stored in directories named
164 slotN
165 in the directory specified after
166 chg\-disk:\&. It does so by creating numbered "drives" so that simultaneous processes can access distinct slots\&. This changer is fast\-search capable\&.
167 .PP
168 The current slot can be accessed using the device name
169 file:VTAPEROOT\&. This is useful for the
170 \fBamrestore\fR(8)
171 command line\&.
172 .SS "Properties"
173 .PP
174 AUTO\-CREATE\-SLOT
175 .RS 4
176
177 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\&.
178 .RE
179 .PP
180 LOCK\-TIMEOUT
181 .RS 4
182
183 The time in seconds amanda wait to lock the statefile (default:1000)
184 .RE
185 .PP
186 MOUNT
187 .RS 4
188
189 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\&.
190 .RE
191 .PP
192 NUM\-SLOT
193 .RS 4
194
195 The minimum number of slots in the changer, where the first slot is slot1\&.  If additional slot directories exist, they will also be used\&.
196 .RE
197 .PP
198 REMOVABLE
199 .RS 4
200
201 If this property is true, then the changer will verify that the changer
202 directory (e\&.g\&., /var/mnt/vtapes) is on a different
203 filesystem from its parent directory (e\&.g\&., /var/mnt)\&.
204 This is useful for removable disks, as it will prevent Amanda from creating
205 slot directories when the removable disk is not mounted\&.
206 .RE
207 .PP
208 UMOUNT
209 .RS 4
210
211 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\&.
212 .RE
213 .PP
214 UMOUNT\-LOCKFILE
215 .RS 4
216
217 If UMOUNT is set, it require a lockfile outside of the mount point to prevent race\&.
218 .RE
219 .PP
220 UMOUNT\-IDLE
221 .RS 4
222
223 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\&.
224 .RE
225 .SS "chg\-disk (old)"
226 .nf
227 tapedev "file:/u01/vtapes"
228 tpchanger "chg\-disk"
229 changerfile "chg\-disk\&.conf"     # optional file
230 .fi
231 .PP
232 This changer script supports sequential access to vtapes stored in directories named
233 slotN
234 in the directory specified by the
235 \fItapedev\fR
236 parameter\&. The configuration file parameter is:
237 .sp
238 .nf
239 LASTSLOT=number    # The number of slots, default to tapecycle setting\&.
240 .fi
241 .PP
242 This changer is not fast\-search capable\&.
243 .SS "chg\-multi:DEVICE\-LIST"
244 .nf
245 tpchanger "chg\-multi:{/dev/nst0,/dev/nst1,/dev/nst2}"
246 changerfile "chg\-multi\-state"
247 .fi
248 .PP
249 This script simply round\-robins a number of distinct device names, as specified in the
250 \fItpchanger\fR
251 setting\&. It is useful when all volumes for a configuration have different device names \-\- for example, if you have many standalone drive\&. The
252 \fIchangerfile\fR
253 must exist; it is used to save the state file\&.
254 .PP
255 The child devices are specified using the same syntax as for the RAIT device (see
256 \fBamanda-changers\fR(7))\&. The range specification can be especially useful here:
257 .sp
258 .nf
259 tpchanger "chg\-multi:s3:mycompany\-backups/tape\-{001\&.\&.100}"
260 .fi
261 .PP
262 This changer is not fast\-search capable\&.
263 .SS "Properties"
264 .PP
265 FIRST\-SLOT
266 .RS 4
267
268 This property gives the number of the first slot\&. The default value is "1"\&.
269 .RE
270 .PP
271 LOCK\-TIMEOUT
272 .RS 4
273
274 The time in seconds amanda wait to lock the statefile (default:1000)
275 .RE
276 .SS "Special Operations"
277 .PP
278 A number of special operations are available for
279 \fBchg\-multi\fR
280 via
281 \fBamtape\fR(8)
282 subcommands\&.
283 .PP
284 The
285 \fBreset\fR
286 subcommand will change the current slot to the first available slot, but does not erase any stored state maintained by the changer\&.
287 .PP
288 The
289 \fBeject\fR
290 subcommand will eject the volume in the given drive
291 .PP
292 The
293 \fBclean\fR
294 subcommand is not yet implemented\&.
295 .PP
296 The
297 \fBupdate\fR
298 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:
299 .sp
300 .nf
301 amtape CONFIG update 1\-3,9
302 .fi
303 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:
304 .sp
305 .nf
306 amtape CONFIG update 2=DailySet\-028
307 .fi
308 In this case, the changer updates its state to indicate that
309 DailySet\-028
310 is in slot 2, without trying to load the tape\&.
311 .sp
312 .nf
313 amtape CONFIG update 1\-3,9=
314 .fi
315 In this case, the changer marks the stated slots as an unknown state\&.
316 .SS "chg\-multi (old)"
317 .nf
318 tpchanger "chg\-multi"
319 changerfile "chg\-multi\-state"
320 .fi
321 .PP
322 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
323 \fIchangerfile\fR
324 need not exist; it is used as a prefix for filenames of state files\&.
325 .PP
326 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:
327 .PP
328 multieject
329 .RS 4
330 If this is 1, use an \*(Aqmt
331 offline\*(Aq command to change to the next tape, or multiple such commands for
332 skipping several tapes at a time\&.
333 .RE
334 .PP
335 needeject
336 .RS 4
337 This option is incompatible with
338 \*(Aqmultieject\*(Aq\&. This should be 1 for changers accessed through several virtual
339 tape devices, when the changer needs the current tape to be ejected before
340 changing to another device\&.
341 .RE
342 .PP
343 gravity
344 .RS 4
345 Set this to 1 if the
346 changer/stacker is unable to loop back to the first tape after unloading the
347 last one, or if you don\*(Aqt want amanda to go through the tape stack looking for
348 the exact tape it wants instead of using the first acceptable one\&.
349 .RE
350 .PP
351 slot X
352 .RS 4
353 The configuration file should list
354 as many \*(Aqslot X\*(Aq statements as the number of slots supported by the changer or
355 the number of separate tape drives used\&.
356 .RE
357 .PP
358 This changer is not fast\-search capable\&.
359 .SS "chg\-manual"
360 .nf
361 tpchanger "chg\-manual"
362 changerfile "chg\-manual\&.conf"
363 .fi
364 .PP
365 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):
366 .sp
367 .nf
368 resend_mail=900       # resend mail every __ seconds
369 timeout_mail=604800   # time out after this many seconds (default 7 days)
370 request="[type]"      # How to request a new tape (default "tty_email")
371   request="tty"       # Use the tty to ask the user to change tape\&.
372                       # Can\*(Aqt be use by cron
373   request="email"     # Send an email to ask the user to change tape\&.
374   request="tty_email" # Use the tty if it exist or send an email\&.
375 .fi
376 .PP
377 This changer is not fast\-search capable\&.
378 .SS "chg\-zd\-mtx (old)"
379 .nf
380 tpchanger "chg\-zd\-mtx"
381 changerdev "/dev/sg0"         # used with \*(Aqmtx \-f\*(Aq
382 changerfile "chg\-zd\-mtx\&.conf"
383 tapedev "tape:/dev/nst0"
384 .fi
385 .PP
386 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
387 \fB\-f\fR
388 option and has subcommands like
389 \fBstatus\fR\&. The configuration file parameters are (as listed in the script itself):
390 .sp
391 .nf
392 firstslot=?                 #### First storage slot (element)
393 lastslot=?                  #### Last storage slot (element)
394 cleanslot=\-1                #### Slot with cleaner tape \-\- default is "\-1"
395                             #### Set negative to indicate no cleaner available
396 driveslot=0                 #### Drive slot number\&.  Defaults to 0
397                             #### Use the \*(AqData Transfer Element\*(Aq you want
398 autoclean=0                 #### Set to \*(Aq1\*(Aq or greater to enable
399 autocleancount=99           #### Number of access before a clean\&.
400 havereader=0                #### If you have a barcode reader, set to 1\&.
401 offline_before_unload=0     #### Does your robot require an
402                             #### \*(Aqmt offline\*(Aq before mtx unload?
403 poll_drive_ready=NN         #### Time (seconds) between tests to see if
404                             #### the tape drive has gone ready (default: 3)\&.
405 max_drive_wait=NN           #### Maximum time (seconds) to wait for the
406                             #### tape drive to become ready (default: 120)\&.
407 initial_poll_delay=NN       #### initial delay after load before polling for
408                             #### readiness
409 slotinfofile=FILENAME       #### record slot information to this file, in
410                             #### the line\-based format "SLOT LABEL\en"
411 .fi
412 .PP
413 This changer is fast\-search capable if and only if
414 \fBhavereader\fR
415 is true\&.
416 .SS "chg\-rait:{CHILD1,CHILD2,\&.\&.}"
417 .nf
418 define changer vtape {
419     tpchanger "chg\-disk:/path/to/vtape"
420 }
421 define changer robot {
422     tpchanger "chg\-robot:/dev/sg0"
423     tapedev "tape:/dev/nst0"
424 }
425 tpchanger "chg\-rait:{vtape,robot}"
426 .fi
427 .PP
428 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
429 \fBamanda-devices\fR(7))\&.
430 .PP
431 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
432 \fBchg\-zd\-mtx\fR
433 child changers (and, naturally, two tape drives)\&. In this arrangement, the first slot would be named
434 {1,11}\&.
435 .PP
436 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}"\&.
437 .PP
438 Drive names are parsed in a similar fashion, for operations that take drive names (clean and eject)\&.
439 .PP
440 This changer is fast\-search capable only if all of its child changers are fast\-search capable\&.
441 .if n \{\
442 .sp
443 .\}
444 .RS 4
445 .it 1 an-trap
446 .nr an-no-space-flag 1
447 .nr an-break-flag 1
448 .br
449 .ps +1
450 \fBNote\fR
451 .ps -1
452 .br
453 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\&.
454 .sp .5v
455 .RE
456 .SS "chg\-null:"
457 .nf
458 tpchanger "chg\-null:"
459 .fi
460 .PP
461 This changer always provides the device "null:"\&. It is sometimes useful in conjunction with
462 \fBchg\-rait:\fR\&.
463 .SS "chg\-robot:DEVICE"
464 .nf
465 define changer robot {
466     tpchanger "chg\-robot:/dev/sg0"
467     property "tape\-device" "0=tape:/dev/rmt/0" "1=tape:/dev/rmt/1"
468     property "eject\-before\-unload" "yes"
469     property "use\-slots" "1\-5,11\-20"
470 }
471 tpchanger "robot"
472 .fi
473 .PP
474 This changer drives a robotic tape library using the operating system\*(Aqs
475 \fBmtx\fR
476 command\&. It replaces the ancient
477 \fBchg\-zd\-mtx\fR
478 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\&.
479 .PP
480 This changer does not accept a
481 \fBchangerdev\fR
482 parameter, but the
483 \fBchangerfile\fR
484 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
485 \fI$localstatedir/amanda\fR, e\&.g\&.,
486 \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\&.
487 .PP
488 With a barcode reader present, it is possible for
489 \fBchg\-robot\fR
490 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
491 \fBamtape\fR(8)
492 subcommand
493 \fBupdate\fR\&.
494 .PP
495 This changer is fast\-search capable even without a barcode reader\&. For such libraries, it is the responsibility of the operator to
496 \fBupdate\fR
497 the changer when tapes are added to or removed from the library\&.
498 .PP
499 There is a shell script in the
500 contrib/
501 directory of Amanda\*(Aqs source distribution which can help you convert a
502 \fBchg\-zd\-mtx\fR
503 configuration into a
504 \fBchg\-robot\fR
505 configuration\&. Just give it your Amanda configuration name:
506 .sp
507 .nf
508   sh contrib/convert\-zd\-mtx\-to\-robot\&.sh $config
509 .fi
510 The script can be downloaded at
511 http://github\&.com/zmanda/amanda/raw/master/contrib/convert\-zd\-mtx\-to\-robot\&.sh
512 .SS "Special Operations"
513 .PP
514 A number of special operations are available for
515 \fBchg\-robot\fR
516 via
517 \fBamtape\fR(8)
518 subcommands\&.
519 .PP
520 The
521 \fBreset\fR
522 subcommand will change the current slot to the first available slot, but does not erase any stored state maintained by the changer\&.
523 .PP
524 The
525 \fBeject\fR
526 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\&.
527 .PP
528 The
529 \fBclean\fR
530 subcommand is not yet implemented\&.
531 .PP
532 The
533 \fBupdate\fR
534 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:
535 .sp
536 .nf
537 amtape CONFIG update 1\-3,9
538 .fi
539 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:
540 .sp
541 .nf
542 amtape CONFIG update 2=DailySet\-028
543 .fi
544 In this case, the changer updates its state to indicate that
545 DailySet\-028
546 is in slot 2, without trying to load the tape\&.
547 .sp
548 .nf
549 amtape CONFIG update 1\-3,9=
550 .fi
551 In this case, the changer marks the stated slots as an unknown state\&.
552 .SS "Properties"
553 .PP
554 DRIVE\-CHOICE
555 .RS 4
556
557 This property controls the algorithm used to select a drive in which to load a
558 tape\&.  If set to the default ("lru"), the changer attempts to use the least
559 recently used drive, resulting in a round\-robin behavior\&.  The "firstavail"
560 algorithm selects the first available drive, thus preferring the first drive
561 specified via the TAPE\-DEVICE property\&.
562 .RE
563 .PP
564 EJECT\-BEFORE\-UNLOAD
565 .RS 4
566
567 Set this boolean property to true if the library requires an
568 \fBoffline\fR operation be performed on the tape drive before it
569 can be unloaded\&.  If set, then \fBmt\fR will be invoked to
570 perform this operation\&.  Most libraries do not require this workaround\&.
571 .RE
572 .PP
573 EJECT\-DELAY
574 .RS 4
575
576 This is the time between ejecting a tape and unloading the volume to a storage slot, and
577 defaults to 0 seconds\&.  It is only used if EJECT\-BEFORE\-UNLOAD is true\&.  See "Timing", below\&.
578 .RE
579 .PP
580 FAST\-SEARCH
581 .RS 4
582
583 This boolean property indicates whether the changer advertises the ability to find
584 volumes without sequential scanning\&.  The traditional taperscan algorithm alters its
585 behavior based on this flag, so it is sometimes necessary to adjust it, although the
586 changer will always search for a desired tape using the most efficient means
587 available\&.  The default value is true\&.
588 .RE
589 .PP
590 IGNORE\-BARCODES
591 .RS 4
592
593 If this boolean property is true, then chg\-robot will ignore any barcode information
594 that the library provides\&.  This property is probably only useful when the library
595 returns incorrect barcodes, for example due to a malfunction in the barcode reader\&.
596 .RE
597 .PP
598 LOAD\-POLL
599 .RS 4
600 This property specifies the timing of Amanda\*(Aqs polling for the tape drive to be ready after loading a new tape\&. See "Timing", below\&.
601 .sp
602 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
603 .sp
604 .nf
605 "D [poll P [until U]]"
606 .fi
607 For a simple delay with no polling, use e\&.g\&.,
608 .sp
609 .nf
610 property "load\-poll" "13s"
611 .fi
612 To delay and then poll, use e\&.g\&.,
613 .sp
614 .nf
615 property "load\-poll" "13s poll 5s"
616 .fi
617 and to add a maximum total time, use e\&.g\&.,
618 .sp
619 .nf
620 property "load\-poll" "0s poll 5s until 2m"
621 .fi
622 The default value is
623 \fB"0s poll 3s until 2m"\fR\&.
624 .RE
625 .PP
626 LOCK\-TIMEOUT
627 .RS 4
628
629 The time in seconds amanda wait to lock the statefile (default:1000)
630 .RE
631 .PP
632 MTX
633 .RS 4
634
635 The path to the \*(Aqmtx\*(Aq binary\&.  The default value is defined at compile time\&.
636 .RE
637 .PP
638 STATUS\-INTERVAL
639 .RS 4
640
641 This is the minimum time between invocations of \fBmtx status\fR
642 to determine the state of the changer library\&.  The default value, 2 seconds,
643 avoids back\-to\-back status invocations but ensures that the metadata is up to
644 date\&.  For operating systems or libraries where the \fBmtx
645 status\fR takes a considerable time to complete, this value should be
646 increased\&.  See "Timing", below\&.
647 .RE
648 .PP
649 TAPE\-DEVICE
650 .RS 4
651
652 This property describes the correspondance of drive numbers in the library to
653 Amanda devices, in the format \fIDRIVE=DEVICE\fR\&.  The property
654 can be specified multiple times to describe multiple devices\&.  The device will
655 usually be a tape device name starting with \fBtape:\fR, but may
656 also refer to a device alias (see \fBamanda-devices\fR(7))\&. As
657 a shortcut, if the \fBtapedev\fR parameter is specified in the
658 changer definition, then it is assumed to be the device name for drive 0\&.
659 .RE
660 .PP
661 UNLOAD\-DELAY
662 .RS 4
663
664 This specifies the minimum time between an unload operation any any subsequent
665 operation\&.  The default value is 0 seconds\&.  See "Timing", below\&.
666 .RE
667 .PP
668 USE\-SLOTS
669 .RS 4
670
671 This property, if specifies, enumerates the slots to which this changer should
672 limit itself\&.  The slots are specified as a comma\-separated list of ranges,
673 e\&.g\&., "1\-5,11\-15,19,22"\&.  The property can be specified more than once, and
674 the resulting sets will be combined\&.  The changer will refuse to load tapes
675 not found in these slots, except for import/export purposes\&.
676 .RE
677 .SS "Timing"
678 .PP
679 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\&.
680 .PP
681 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\&.
682 .PP
683 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\&.
684 .PP
685 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\&.
686 .PP
687 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\&.
688 .PP
689 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\&.
690 .PP
691 Each of the times specified in these properties may be given as integers with the optional suffix
692 \fBs\fR
693 for seconds (the default) or
694 \fBm\fR
695 for minutes\&.
696 .SS "chg\-ndmp:HOST[:PORT]@SCSIDEV"
697 .nf
698     tpchanger "chg\-ndmp:filer\&.company\&.com@/dev/sg0"
699     property        "tape\-device" "0=ndmp:filer\&.company\&.com@/dev/rtape0"
700     property append "tape\-device" "1=ndmp:filer\&.company\&.com@/dev/rtape1"
701     property "use\-slots" "1\-12"
702     property "ndmp\-auth" "text"
703     property "ndmp\-username" "luke"
704     property "ndmp\-password" "leia"
705 .fi
706 .PP
707 This changer is very similar to
708 \fBchg\-robot\fR, but controls a tape changer on an NDMP server instead of a local device\&. The
709 \fBHOST\fR
710 in the
711 \fBtpchanger\fR
712 should be the hostname of the NDMP server\&. The
713 \fBPORT\fR
714 is optional\&. The
715 \fBSCSIDEV\fR
716 should specify the SCSI device on the NDMP server which controls the changer\&. The format of this parameter is implementation\-specific\&.
717 .PP
718 The appropriate authentication properties will be automatically set on any devices created by this changer\&.
719 .SS "Properties"
720 .PP
721 This changer supports all of the properties supported by
722 \fBchg\-robot\fR, although the value of
723 \fBMTX\fR
724 is ignored\&. The following properties are also recognized:
725 .PP
726 NDMP_AUTH
727 .RS 4
728
729 Authentication method to use to connect to the NDMP server\&.  One of
730 "md5" (default), "text", "none" (for an empty authentication attempt) or "void" (for
731 no authentication attempt at all)\&.
732 .RE
733 .PP
734 NDMP\-PASSWORD
735 .RS 4
736
737 The password for the NDMP server\&.
738 .RE
739 .PP
740 NDMP\-USERNAME
741 .RS 4
742
743 The username for the NDMP server\&.
744 .RE
745 .PP
746 VERBOSE
747 .RS 4
748
749 If true, enables the NDMJOB library\*(Aqs verbose (packet\-level) debugging\&.
750 .RE
751 .SS "chg\-single:DEVICE"
752 .nf
753 tpchanger "chg\-single:tape:/dev/nst0"
754 .fi
755 .PP
756 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\&.
757 .PP
758 The
759 \fBchg\-single\fR
760 changer has no property\&.
761 .SS "Unmaintained Changers"
762 .PP
763 Amanda has many other changer scripts and programs beyond those described here (see the
764 changer\-src/
765 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\&.
766 .SH "SEE ALSO"
767 .PP
768 \fBamanda\fR(8),
769 \fBamanda.conf\fR(5),
770 \fBamanda-devices\fR(7)
771 .PP
772 The Amanda Wiki:
773 : http://wiki.zmanda.com/
774 .SH "AUTHOR"
775 .PP
776 \fBDustin J\&. Mitchell\fR <\&dustin@zmanda\&.com\&>
777 .RS 4
778 Zmanda, Inc\&. (http://www\&.zmanda\&.com)
779 .RE