]> git.sur5r.net Git - bacula/docs/blob - docs/manual-de/console.tex
Update
[bacula/docs] / docs / manual-de / console.tex
1 %%
2 %%
3
4 \chapter{Bacula Console}
5 \label{_ConsoleChapter}
6 \index[general]{Console!Bacula}
7 \index[general]{Bacula Console}
8 \index[general]{Console!Bacula}
9 \index[general]{Bacula Console}
10
11 Die {\bf Bacula Console} (manchmal auch das BenutzerInterface genannt) 
12 ist ein Programm, dass es dem Anwender oder System Aministrator erlaub,
13 den Bacula-Director-Dienst im laufenden Betrieb zu kontrollieren.
14
15 Momentan gibt es zwei Versionen des Console-Programms: eine Shell- (TTY)
16 und eine GNOME GUI-Version. Beide erlauben es dem Administrator oder
17 autorisierten Benutzern Bacula zu steuern. Sie k\"{o}nnen sich den Status
18 eines bestimmten Jobs bzw. den Inhalt des Katalogs anzeigen lassen,
19 oder bestimmte Aktionen mit Tapes und Autochangern durchf\"{u}hren.
20
21 Zus\"{a}tzlich gibt es noch die bwx-Console, die auf wxWidgets aufbaut,
22 und eine M\"{o}glichkeit bietet, den Wiederherstellungsproze{\ss} graphisch zu steuern.
23 Die bwx-Console befindet sich in einem fr\"{u}hen Entwicklungsstadium und
24 wurde leider seit einiger Zeit nicht weiterentwickelt. (Trotzdem kann sie sehr hilfreich sein.)
25
26 Da sich alle Bacula-Consolen \"{u}ber das Netzwerk mit dem Director-Dienst verbinden,
27 ist es nicht notwendig sie auf dem selben Computer laufen zu lassen.
28
29 Ein gewisses, minimales Grundwissen \"{u}ber die Console ist schon dann notwendig,
30 wenn Bacula auf mehr als einem Tape schreiben soll. Bacula wird n\"{a}mlich nach einem
31 leeren Band fragen, falls keines mehr verf\"{u}gbar ist, und erst nach dem mounten
32 eines neuen Tapes mittels der Console, wird Bacula weiterarbeiten k\"{o}nnen.
33
34 \section{Console Konfiguration}
35 \index[general]{Console Konfiguration}
36 \index[general]{Konfiguration!Console}
37 \index[general]{Console Konfiguration}
38 \index[general]{Konfiguration!Console}
39
40 Wenn Sie die Bacula-Console starten, liest sie ihre Standard-Konfigurations-Datei
41 namens {\bf bconsole.conf}, bzw. {\bf bgnome-console.conf} f\"{u}r die GNOME-Console, ein.
42 Im einfachsten Fall enth\"{a}llt diese Datei nur den Namen und die Adresse des Director-Dienstes
43 sowie das Passwort, dass f\"{u}r die Verbindung zum Director-Dienst ben\"{o}tigt wird.
44 F\"{u}r weitere Informationen zu dieser Datei, lesen Sie bitte das Kapitel \"{u}ber die \ilink{Console-Konfiguration-Datei}{ConsoleConfChapter} in diesem Handbuch.
45
46 \section{Benutzung des Console-Programms}
47 \index[general]{Benutzung des Console-Programms}
48 \index[general]{Programm!Benutzung des Console-}
49 \index[general]{Benutzung des Console-Programms}
50 \index[general]{Programm!Benutzungs des Console-}
51
52 Das Console-Programm kann mit den folgenden Optionen gestartet werden:
53 \footnotesize
54 \begin{verbatim}
55 Usage: bconsole [-s] [-c Konfigurations-Datei] [-d Debug-Level]
56        -c <Datei>  gibt die zu verwendene Konfigurations-Datei an
57        -dnn        setzt den Debug-Lavel auf nn
58        -n          kein conio
59        -s          keine Signale (*)
60        -t          test - list die Konfigurations-Datei und beendet sich dann
61        -?          gibt diese Hilfe aus.
62 \end{verbatim}
63 \normalsize
64
65 (*) \elink{Signale}{http://de.wikipedia.org/wiki/Signal\_\%28Computer\%29}
66
67 Nach dem Start des Console-Programms zeigt es durch sein Prompt (*) an,
68 dass es auf Benutzereingaben wartet. (in der GNOME-Console gibt es kein Prompt,
69 geben Sie die Befehle bitte einfach in der Textbox unten im Fenster ein.)
70 Sie k\"{o}nnen in jeder Console einfach nur das Kommando eingeben, wenn weitere Parameter
71 erforderlich sind, wird das Programm Sie danach fragen. Alternativ k\"{o}nnen Sie
72 nat\"{u}rlich auch das komplette Kommando mit allen ben\"{o}tigten Parametern eingeben
73 und ausf\"{u}hren. Das normale Befehlsformat ist dieses:
74
75 \footnotesize
76 \begin{verbatim}
77  <Kommando> <Parameter1>[=<Argument1>] <Parameter2>[=<Argument2>] ...
78 \end{verbatim}
79 \normalsize
80
81 wobei {\bf Kommando} einer der unten aufgef\"{u}hrten Console-Befehle
82 und {\bf Parameter} eines der unten aufgelisteten Schl\"{u}sselw\"{o}rter ist,
83 dem dann meistens ein {\bf Argument} folgt. Alle Befehle k\"{o}nnen in der
84 k\"{u}rzesten eindeutigen Form eingegeben werden. Falls zwei Befehle mit identischen
85 Buchstaben anfangen, wird der ausgef\"{u}hrt, der in der Ausgabe des {\bf help}-Kommandos
86 am weitesten oben steht. Wenn Sie das andere Kommando ausf\"{u}hren m\"{o}chten m\"{u}ssen Sie
87 dementsprechend mehr Buchstaben eingeben, um es eindeutig anzugeben. Keiner der
88 Parameter darf abgek\"{u}rzt werden.
89
90 Ein Beispiel:
91
92 \footnotesize
93 \begin{verbatim}
94 list files jobid=23
95 \end{verbatim}
96 \normalsize
97
98 zeigt alle gesicherten Dateien mit der JobID 23 an.
99
100 \footnotesize
101 \begin{verbatim}
102 show pools
103 \end{verbatim}
104 \normalsize
105
106 zeigt alle Pool-Konfigurations-Eintr\"{a}ge an. 
107
108 Die maximale L\"{a}nge der eingegebenen Befehle, mit Parametern, ist 511 Zeichen.
109 Falls Sie die Console \"{u}ber ein Script ansprechen, denken Sie bitte daran,
110 dass Sie dieses Limit nicht \"{u}berschreiten.
111
112 \section{Beenden des Console-Programs}
113 \index[general]{Programm!Beenden des Console-}
114 \index[general]{Beenden des Console-Programms}
115 \index[general]{Programm!Beenden des Console-}
116 \index[general]{Beenden des Console-Programms}
117
118 Normalerweise beenden Sie das Console-Programm durch die Eingabe von {\bf quit} oder {\bf exit}.
119 Allerdings wartet die Console bis der Director-Dienst das Kommando best\"{a}tigt. Wenn der
120 Director bereits ein l\"{a}nger laufendes Kommando ausf\"{u}hrt, kann es sein, dass das Beenden
121 der Console einen Moment dauert. Falls Sie die Console sofort verlassen wollen, k\"{o}nnen Sie
122 in dem Fall das Kommando {\bf .quit} verwenden.
123
124 Momentan gibt es keinen Weg ein laufendes Kommando nach dem Starten abzubrechen (z.B. mit STRG+C).
125 Allerdings k\"{o}nnen Sie jederzeit, wenn die Console Sie nach einer weiteren Eingabe fragt,
126 das aktuelle Kommmando beenden, indem Sie einen Punkt {\bf .} eingeben. Nach der Eingabe des Punktes,
127 werden Sie automatisch zum Hauptprompt oder bei verschachtelten Abfragen zum passenden letzten Prompt
128 zur\"{u}ckgeleitet. Bei einigen Eingaben, wie zum Beispiel der Frage nach einem Volume-Namen, wird
129 der Punkt als Eingabe gewertet und Sie haben beim n\"{a}chsten Prompt die M\"{o}glichkeit,
130 das Kommando abzubrechen.
131
132 \label{keywords}
133 \section{Alphabetische Liste der Console-Schl\"{u}sselw\"{o}rter}
134 \index[general]{Schl\"{u}sselw\"{o}rter!Alphabetische Liste der Console}
135 \index[general]{Alphabetische Liste der Console-Schl\"{u}sselw\"{o}rter}
136 \index[general]{Schl\"{u}sselw\"{o}rter!Alphabetische Liste der Console}
137 \index[general]{Alphabetische Liste der Console-Schl\"{u}sselw\"{o}rter}
138 Wenn es nicht anders angegeben ist, ben\"{o}tigt jedes der folgenden Schl\"{u}sselw\"{o}rter
139 (Parameter der Console-Befehle) ein Argument, welches dem Schl\"{u}sselwort,
140 getrennt durch ein Gleichheitszeichen, folgt.
141 Ein Beispiel:
142 \begin{verbatim}
143 jobid=536
144 \end{verbatim}
145
146 Bitte beachten Sie, dass diese Liste durch die st\"{a}ndig weitergehende
147 Entwicklung eventuell weder komplett, noch in der Richtigen alphabetischen
148 Reihenfolge sein kann.
149
150 \begin{description}
151 \item [restart]
152   Parameter des python-Kommandos,
153   dadurch wird der python-Interpreter neu gestartet. Ben\"{o}tigt keine Argumente.
154 \item [all]
155   Parameter des status und show-Kommandos,
156   dadurch werden alle Komponenten oder Eintr\"{a}ge ausgew\"{a}hlt
157 \item [allfrompool]
158   Parameter des update-Kommandos,
159   gibt an das alle Volumes des (im Parameter pool angegebenen) Pools
160   aktualisiert werden sollen.
161 \item [allfrompools]
162   Parameter des update-Kommandos,
163   gibt an das alle Volumes aller Pools aktualisiert werden sollen.
164 \item [before]
165   Parameter des restore-Kommandos.
166 \item [bootstrap]
167   Parameter des restore-Kommandos.
168 \item [catalog]
169   im use-Kommando erlaubt,
170   um den zu benutzenden Katalog auszuw\"{a}hlen
171 \item [catalogs]
172   Parameter des show-Kommandos.
173   Ben\"{o}tigt keine Argumente.
174 \item [client | fd]
175 \item [clients]
176   Parameter des show, list und llist-Kommandos,
177   bezeichnet alle Clients. Ben\"{o}tigt keine Argumente.
178 \item [counters]
179   im show-Kommando erlaubt.
180   Ben\"{o}tigt keine Argumente.
181 \item [current]
182   Parameter des restore-Kommandos.
183   Ben\"{o}tigt keine Argumente.
184 \item [days]
185   definiert die Anzahl der Tage, die das "list nextvol"-Kommando
186   in Betracht ziehen soll. Der Parameter days kann auch im Kommando
187   "status director" verwendet werden, um die geplanten Jobs f\"{u}r die
188   angegebene Anzahl Tage zu zeigen.
189 \item [devices]
190   Parameter des show-Kommandos.
191   Ben\"{o}tigt keine Argumente.
192 \item [dir | director]
193 \item [directors]
194   Parameter des show-Kommandos.
195   Ben\"{o}tigt keine Argumente.
196 \item [directory]
197   Parameter des restore-Kommandos.
198   Das Argument gibt das wiederherzustellende Verzeichnis an.
199 \item [enabled]
200   Dieser Parameter kann bei den Kommandos "update volumes" und "update slots"
201   verwendet werden. Das Argument kann yes, true, no, false, archived, 0,1 oder 2 sein.
202   0 ist identisch mit no oder false, 1 mit yes oder true und 2 mit archived.
203   Archived Volumes werden weder benutzt noch automatisch aus dem Katalog gel\"{o}scht.
204   Volumes die nicht enabled sind, werden nicht f\"{u}r das Backup oder die Wiederherstellung benutzt.
205 \item [done]
206   wird im restore-Kommando benutzt.
207   Ben\"{o}tigt keine Argumente.
208 \item [file]
209   Parameter des restore-Kommandos.
210 \item [files]
211   Parameter des list und llist-Kommandos.
212   Ben\"{o}tigt keine Argumente.
213 \item [fileset]
214 \item [filesets]
215   Parameter des show-Kommandos.
216   Ben\"{o}tigt keine Argumente.
217 \item [help]
218   Parameter des show-Kommandos.
219   Ben\"{o}tigt keine Argumente.
220 \item [jobs]
221   Parameter des show, list und llist-Kommandos.
222   Ben\"{o}tigt keine Argumente.
223 \item [jobmedia]
224   Parameter des list und llist-Kommandos.
225   Ben\"{o}tigt keine Argumente.
226 \item [jobtotals]
227   Parameter des list und llist-Kommandos.
228   Ben\"{o}tigt keine Argumente.
229 \item [jobid]
230   Parameter des list und llist-Kommandos.
231   Die jobid ist die numerische Jobid, die im Job-Report angezeigt wird.
232   Sie ist der Index f\"{u}r die Datenbankeintr\"{a}ge des entsprechenden Jobs.
233   Da sie f\"{u}r alle in der Datenbank existierenden Jobs einzigartig ist,
234   kann sie erst wiederverwendet werden, wenn der vorherige Job mit dieser Jobid
235   aus der Datenbank gel\"{o}scht wurde.
236 \item [job | jobname]
237   Parameter des list und llist-Kommandos.
238   Der Job oder JobName entspricht dem Namen den Sie im Job-Eintr\"{a}g
239   angegeben haben, somit bezieht er sich auf alle Jobs dieses Namens,
240   die jemals gelaufen sind und deren Eintr\"{a}ge noch im Katalog existieren.
241 \item [level]
242 \item [listing]
243   Parameter des estimate-Kommandos.
244   Ben\"{o}tigt keine Argumente.
245 \item [limit]
246 \item [messages]
247   Parameter des show-Kommandos.
248   Ben\"{o}tigt keine Argumente.
249 \item [media]
250   Parameter des list und llist-Kommandos.
251   Ben\"{o}tigt keine Argumente.
252 \item [nextvol | nextvolume]
253   Parameter des list und llist-Kommandos.
254   Ben\"{o}tigt keine Argumente.
255 \item [on]
256   Ben\"{o}tigt keine Argumente.
257 \item [off]
258   Ben\"{o}tigt keine Argumente.
259 \item [pool]
260 \item [pools]
261   Parameter des show, list und llist-Kommandos.
262   Ben\"{o}tigt keine Argumente.
263 \item [select]
264   Parameter des restore-Kommandos.
265   Ben\"{o}tigt keine Argumente.
266 \item [storages]
267   Parameter des show-Kommandos.
268   Ben\"{o}tigt keine Argumente.
269 \item [schedules]
270   Parameter des show-Kommandos.
271   Ben\"{o}tigt keine Argumente.
272 \item [sd | store | storage]
273 \item [ujobid]
274   Parameter des list-Kommandos.
275   Die ujobid ist eine M\"{o}glichkeit einen Job eindeutig zu identifizieren.
276   Momentan besteht die ujobid aus dem JobNamen und der Uhrzeit wann der Job gelaufen ist.
277 \item [volume]
278 \item [volumes]
279   Parameter des list und llist-Kommandos.
280   Ben\"{o}tigt keine Argumente.
281 \item [where]
282   Parameter des restore-Kommandos.
283 \item [yes]
284   Parameter des restore-Kommandos.
285   Ben\"{o}tigt keine Argumente.
286 \end{description}
287
288 \label{list}
289 \section{Alphabetische Liste der Console-Kommandos}
290 \index[general]{Kommandos!Alphabetische Liste der Console-}
291 \index[general]{Alphabetische Liste der Console-Kommandos}
292 \index[general]{Kommandos!Alphabetische Liste der Console-}
293 \index[general]{Alphabetische Liste der Console-Kommandos}
294
295 Die folgenden Kommandos sind derzeit verf\"{u}gbar:
296
297 \begin{description}
298 \item [{add [pool=\lt{}pool-name\gt{} storage=\lt{}storage\gt{}
299    jobid=\lt{}JobId\gt{}]} ]
300    \index[general]{add}
301    Das add-Kommando wird benutzt um Volumes zu einem bestehenden Pool
302    hinzuzuf\"{u}gen. Dazu wird der Volume-Eintrag in der Datenbank erzeugt
303    und das Volume dem Pool zugeordnet. Dabei erfolgt kein physikalischer Zugriff
304    auf das Volume. Nach dem hinzuf\"{u}gen zu einem Pool, geht Bacula davon
305    aus, dass das Volume wirklich existiert und auch bereits gelabelt ist.
306    Dises Kommando wird normalerweise nicht benutzt, da Bacula die Volumes
307    automatisch beim labeln einem Pool hinzuf\"{u}gt. Allerdings ist es hilfreich,
308    falls Sie ein Volume aus dem Katalog gel\"{o}scht haben und es sp\"{a}ter wieder
309    hinzuf\"{u}gen wollen.
310
311    Typischerweise wird das label-Kommando anstelle des add-Kommandos benutzt, da
312    es au{\ss}er dem labeln des physikalischen Volumes, die identischen Schritte
313    wie das add-Kommando ausf\"{u}hrt. Das add-Kommando \"{a}ndert nur die Katalog-Eintr\"{a}ge
314    und nicht die physikalischen Volumes. Die physikalischen Volumes m\"{u}ssen
315    vorhanden und gelabelt sein (normalerweise mit dem label-Kommando). Trotzdem
316    kann das add-Kommando sinnvoll sein, wenn Sie zum Beispiel eine bestimmte Anzahl
317    von Volumes einem Pool hinzuf\"{u}gen wollen, wobei die Volumes erst zu einem
318    sp\"{a}teren Zeitpunkt gelabelt werden. Auch um ein Volume eines anderen Bacula-Systems
319    (bzw. anderen Director-Dienstes) zu importieren, kann das add-Kommando benutzt werden.
320    Die erlaubten Zeichen f\"{u}r einen Volume-Namen finden Sie weiter unten
321    in der Beschreibung des label-Kommandos.
322
323 \item [autodisplay on/off]
324    \index[general]{autodisplay on/off}
325    Das autodisplay-Kommando kennt zwei Parameter: {\bf on} und {\bf off},
326    wodurch die automatische Anzeige von Nachrichten in der Console entsprechend
327    ein- oder ausgeschaltet wird. Der Standardwert ist {\bf off}, was bedeutet, dass
328    Sie \"{u}ber neue Meldungen benachrichtigt werden, sie aber nicht automatisch
329    angezeigt werden. In der GNOME-Console ist das automatische Anzeigen dagegen
330    standardm\"{a}{\ss}ig aktiviert, d.h. neue Meldungen werden automatisch
331    ausgegeben, wenn sie vom Director-Dienst empfangen wurden (typischerweise innerhalb von
332    ca. 5 Sekunden nachdem sie generiert wurden).
333
334    Wenn autodisplay auf off steht, m\"{u}ssen Sie neu Nachrichten mit dem
335    {\bf messages}-Kommando abrufen, um sie sich anzeigen zu lassen.
336    Wenn autodiplay auf on steht, werden die Nachrichten angezeigt, sobald die Console sie
337    empfangen hat.
338
339 \item [automount on/off]
340    \index[general]{automount on/off}
341    Das automount-Kommando kennt zwei Parameter: {\bf on} und {\bf off},
342    die entsprechend das automatische mounten nach dem labeln ({\bf label}-Kommando)
343    an- oder ausschalten. Der Standardwert ist on. Wenn automount ausgeschaltet ist,
344    m\"{u}ssen Sie nach dem labeln eines Volumes dieses explizit mounten ({\bf mount}-Kommando),
345    um es benutzen zu k\"{o}nnen.
346
347 \item [{cancel [jobid=\lt{}number\gt{} job=\lt{}job-name\gt{} ujobid=\lt{}unique-jobid\gt{}]}]
348    \index[general]{cancel jobid}
349    Das cancel-Kommande wird benutzt um einen Job abzubrechen und kennt die
350    Parameter {\bf jobid=nnn} or {\bf job=xxx}, wober jobid die numerische JobID ist
351    und job der Job-Name. Wenn Sie weder job noch jobid angeben, listet die Console
352    alle in Frage kommenden Jobs auf und erlaubt Ihnen aus dieser Liste den abzubrechenden
353    Job auszuw\"{a}hlen.
354
355    Wenn ein Job als abzubrechen gekennzeichnet wurde, kann es einige Zeit dauern,
356    bis er tats\"{a}chlich beendet wird (normalerweise innerhalb einer Minute).
357    Dise Zeit ist aber abh\"{a}ngig davon, was der Job gerade tut.
358
359 \item [{create [pool=\lt{}pool-name\gt{}]}]
360    \index[general]{create pool}
361    Das create-Kommando wird normalerweise nicht benutzt, da die Pool-Eintr\"{a}ge
362    im Katalog automatisch angelegt werden, wenn der Director-Dienst startet und
363    er seine Pool-Konfiguration aus den Konfigurations-Dateien einliest. Falls ben\"{o}tigt,
364    kann mit diesem Kommando ein Pool-Eintrag in der Katalog-Datenbank erstellt werden,
365    der auf einem Pool-Konfigurations-Eintrag basiert, der in der Director-Dienst-Konfiguration
366    enthalten ist. Einfach gesagt \"{u}bernimmt dieses Kommando nur den Pool-Eintrag aus der
367    Konfiguration in die Datenbank. Normalerweise wird diese Kommando automatisch ausgef\"{u}hrt,
368    wenn der Pool zum ersten mal in einem Job-Eintrag benutzt wird. Wenn Sie dieses Kommando
369    auf einem bestehenden Pool ausf\"{u}hren, wird der Katalog sofort aktualisiert und enth\"{a}lt
370    dann die identische Pool-Konfiguration, wie die Konfigurations-Dateien. Nach dem Erstellen
371    eines Pool in den Konfigurations-Dateien werden Sie allerdings h\"{o}chstwahrscheinlich
372    das {\bf label}-Kommando benutzen, um ein oder mehrere Volumes dem neuen Pool hinzuzuf\"{u}gen
373    und die entsprechenden Eintr\"{a}ge im Katalog zu erzeugen, anstatt des create-Kommandos.
374
375    Wenn ein Job gestartet wird und Bacula bemerkt, dass keine passender Pool-Eintrag im Katalog ist
376    aber in den Konfigurations-Dateien, dann wird der Pool im Katalog automatisch angelegt.
377    Wenn Sie m\"{o}chten, dass der Pool-Eintrag sofort (ohne das ein Job mit diesem Pool gestartet wurde)
378    im Katalog erscheint, k\"{o}nnen Sie einfach diese Kommando ausf\"{u}hren, um diesen Vorgang
379    zu erzwingen.
380
381 \item [{delete [volume=\lt{}vol-name\gt{} pool=\lt{}pool-name\gt{}  job
382    jobid=\lt{}id\gt{}]}]
383    \index[general]{delete}
384    Das delete-Kommando wird benutzt um ein Volume, einen Pool oder einen Job-Eintrag,
385    sowie jeweils alle dazugeh\"{o}rigen Datenbank-Eintr\"{a}ge, aus dem Katalog zu
386    entfernen. Das Kommando \"{a}ndert nur die Katalog-Datenbank, es hat keine
387    Auswirkungen auf die Konfigurations-Dateien oder die Daten auf den Volumes.
388    Wir empfehlen Ihnen dieses Kommando nur zu benutzen, wenn Sie wirklich wissen was Sie tun.
389
390    Wenn der Parameter {\bf Volume} angegeben wird, wird das entsprechende Volume aus dem Katalog
391    gel\"{o}scht, wenn ein {\bf Pool} angeben wird, der entsprechende Pool und bei Angabe des Parameters
392    {\bf Job} der entsprechende Job, sowie alle zu diesem Job geh\"{o}hrenden JobMedia- und Datei-Eintr\"{a}ge.
393    Das delete-Kommando kann folgenderma{\ss}en aufgerufen werden:
394
395 \begin{verbatim}
396 delete pool=<pool-name>  oder
397 \end{verbatim}
398
399 \begin{verbatim}
400 delete volume=>volume-name> pool=>pool-name>  oder
401 \end{verbatim}
402
403 \begin{verbatim}
404 delete JobId=>job-id> JobId=>job-id2> ...  oder
405 \end{verbatim}
406
407 \begin{verbatim}
408 delete Job JobId=n,m,o-r,t ...
409 \end{verbatim}
410
411    Das erste Beispiel l\"{o}scht einen Pool-Eintrag aus der Katalog-Datenbank.
412    Das zweite l\"{o}scht einen Volume-Eintrag aus dem angegebenen Pool
413    und das dritte Beispiel l\"{o}scht die genannten JobID-Eintr\"{a}ge aus
414    dem Katalog. Es werden die JobIDs n, m, o, p, q, r und t gel\"{o}scht,
415    wobei die JobID's n, m, o ... nat\"{u}rlich Zahlen entsprechen m\"{u}ssen.
416    Wie Sie sehen kann das delete-Kommando Listen von JobIDs und auch Bereiche
417    (z.B. o-r) verarbeiten.
418
419 \item [disable job\lt{}job-name\gt{}]
420   \index[general]{disable}
421   Das disable-Kommando erlaubt es Ihnen, zu verhindern das ein Job
422   automatisch durch den Director-Dienst ausgef\"{u}hrt wird. Wenn Sie den Director-Dienst
423   neu starten, wird der Status des Jobs wieder auf den Wert gesetzt, der
424   im Job-Eintrag der Director-Konfiguration eingetragen ist.
425
426 \item [enable job\lt{}job-name\gt{}]
427   \index[general]{enable}
428   Das enable-Kommando erlaubt es Ihnen, einen Job der durch das
429   disable-Kommando aus der automatischen Job-Planung entfernt wurde,
430   wieder zu aktivieren. Wenn Sie den Director-Dienst neu starten,
431   wird der Status des Jobs wieder auf den Wert gesetzt, der im
432   Job-Eintrag der Director-Konfiguration eingetragen ist.
433
434 \label{estimate}
435 \item [estimate]
436    \index[general]{estimate}
437    Mit dem estimate-Kommando k\"{o}nnen Sie sich anzeigen lassen, welche
438    Dateien durch einen bestimmten Job gesichert werden, ohne diesen Job
439    ausf\"{u}hren zu m\"{u}ssen. Standardm\"{a}{\ss}ig wird dabei ein Voll-Backup
440    angenommen. Sie k\"{o}nnen das aber durch den Parameter level entsprechend anpassen,
441    indem Sie zum Beispiel {\bf level=Incremental} oder {\bf level=Differential} an das
442    estimate-Kommando mit \"{u}bergeben. Wenn Sie im Aufruf des Kommandos keinen Job-Name
443    angegeben, wird die Console Ihnen ein Auswahlliste der m\"{o}glichen Jobs anzeigen.
444    Zus\"{a}tzlich k\"{o}nnen Sie noch die Parameter Client und FileSet angeben. Nach dem
445    Starten des Kommandos wird der Director-Dienst den Client kontaktieren der daraufhin
446    eine Liste der zu sichernden Dateien mit ihrer Gr\"{o}{\ss}e zur\"{u}ckgibt. Bitte beachten
447    Sie, dass das estimate-Kommando nur die Anzahl der von der Datei belegten Bl\"{o}cke zur
448    Bestimmung der Dateigr\"{o}{\ss}e einbezieht, so dass die Datenmenge die das estimate-Kommando
449    anzeigt immer etwas gr\"{o}{\ss}er sein wird, als das echte Backup.
450
451    Wahlweise k\"{o}nnen Sie noch den Parameter {\bf listing} mit \"{u}bergeben,
452    dann wird eine Liste aller zu sichernden Dateien ausgegeben. Abh\"{a}ngig vom FileSet
453    kann diese Liste sehr lang sein und es daher einige Zeit dauern, alle Dateien anzuzeigen.
454    Das estimate-Kommando kann folgenderma{\ss}en aufgerufen werden:
455
456
457 \begin{verbatim}
458 estimate job=<job-name> listing client=<client-name> 
459        fileset=<fileset-name> level=<level-name>  
460 \end{verbatim}
461
462    die Angabe des Jobs ist ausreichend, aber Sie k\"{o}nnen durch Angabe
463    des Clients, FileSets und/oder des Backup-Levels die entsprechenden Werte \"{u}berschreiben.
464
465 Zum Beispiel k\"{o}nnen Sie folgendes eingeben:
466
467 \footnotesize
468 \begin{verbatim}
469      @output /tmp/listing
470      estimate job=NightlySave listing level=Incremental
471      @output
472 \end{verbatim}
473 \normalsize
474
475    durch das erste Kommando wird die Ausgabe der Console in die Datei
476    {\bf /tmp/listing} umgeleitet. Dann wird durch das estimate-Kommando
477    eine Liste aller Dateien erstellt, die beim n\"{a}chsten inkrementellen
478    Backup des Jobs {\bf NightlySave} gesichert werden. Die Console gibt dabei keine
479    Meldungen aus, da die Ausgabe ja auf die Datei /tmp/listing zeigt. Durch
480    das dritte Kommando @output wird die Umleitung der Ausgabe wieder aufgehoben.
481    Beachten Sie bitte, dass die angezeigten Bytes in der Ausgabe des estimate-Kommandos
482    \"{u}ber die Angabe der Dateigr\"{o}{\ss}e im Verzeichnis-Eintrag bestimmt wird.
483    Das kann zu gro{\ss}en Abweichungen bei der ermittelten Backup-Gr\"{o}{\ss}e f\"{u}hren,
484    falls im FileSet \elink{sparse}{http://de.wikipedia.org/wiki/Sparse-Datei}-Dateien
485    vorhanden sind. sparse-Dateien finden sich oft auf 64-Bit-Maschinen, wo sie f\"{u}r
486    bestimmte Systemdateien benutzt werden. Die angezeigten Bytes sind die Gesammtgr\"{o}{\ss}e
487    der gesicherten Dateien, wenn die FileSet-Option "sparse" nicht gesetzt ist.
488    Momentan gibt es keinen Weg, um mit dem estimate-Kommando die echte Backup-Gr\"{o}{\ss}e
489    f\"{u}r ein FileSet anzuzeigen, bei dem die sparse-Option gesetzt ist.
490
491 \item [help]
492    \index[general]{help}
493    Das help-Kommando zeigt alle verf\"{u}gbaren Kommandos mit einer kurzen Beschreibung an.
494
495 \item [label]
496    \index[general]{label}
497    \index[general]{relabel}
498    \index[general]{label}
499    \index[general]{relabel}
500    Das label-Kommando wird benutzt um physikalische Volumes zu labeln.
501    Das label-Kommando kann folgenderma{\ss}en aufgerufen werden:
502
503 \begin{verbatim}
504 label storage=>storage-name> volume=>volume-name> slot=>slot>
505 \end{verbatim}
506
507    Wenn Sie einen der Parameter storage, volume oder slot nicht angeben,
508    werden Sie von der Console danach gefragt. Der Media-Typ wird automatisch
509    anhand des Storage-Eintrags in der Director-Konfiguration gesetzt.
510    Wenn alle ben\"{o}tigten Informationen vorliegen, kontaktiert die
511    Console den angegebenen Storage-Dienst und sendet das label-Kommando.
512    Wenn das labeln erfolgreich war, wird ein entsprechender Volume-Eintrag
513    im passenden Pool erzeugt.
514
515    Im Volume-Name d\"{u}rfen Buchstaben, Zahlen und folgende Sonderzeichen
516    verwendet werden: Binde- ({\bf -}) und Unterstrich ({\bf \_}),
517    Doppelpunkt ({\bf :}) und Punkt ({\bf .}). Alle anderen Zeichen,
518    einschlie{\ss}lich des Leerzeichens, sind nicht erlaubt.
519    Durch diese Einschr\"{a}nkung soll sichergestellt werden, dass
520    die Volume-Namen gut lesbar sind und es nicht zu Benutzerfehlern
521    aufgrund von Sonderzeichen im Namen kommt.
522
523    Bitte beachten Sie, dass Bacula einen Ein-/Ausgabefehler meldet,
524    wenn ein neues bzw. komplett leeres Volume gelabelt wird. Bacula
525    versucht den ersten Block des Volumes zu lesen, um ein eventuell schon
526    vorhandenes label nicht zu \"{u}berschreiben, dieser Versuch erzeugt
527    den oben genannten Fehler. Um diesen Fehler zu vermeiden, k\"{o}nnen Sie
528    mit den folgenden Shell-Kommandos ein EOF am den Anfang des Volumes schreiben:
529
530 \footnotesize
531 \begin{verbatim}
532        mt rewind
533        mt weof
534        
535 \end{verbatim}
536 \normalsize
537
538 Das label-Kommando kann aufgrund verschiedener Gr\"{u}nde fehlschlagen:
539
540 \begin{enumerate}
541 \item Der angegebene Volume-Name existiert schon in der Katalog-Datenbank
542
543 \item Der Storage-Dienst hat schon ein Tape oder anderes Volume in dem
544       ben\"{o}tigten Ger\"{a}t gemountet. In diesem Fall m\"{u}ssen Sie
545       das Ger\"{a}t erst mit dem {\bf unmount}-Kommando freigeben und dann
546       ein leeres Volume zum labeln einlegen.
547
548 \item Das Volume ist bereits gelabelt. Bacula wird niemals ein bestehendes label
549       \"{u}berschreiben, solange das Volume nicht abgelaufen ist und Sie das
550       {\bf relabel}-Kommando verwenden.
551
552 \item Es ist kein Volume im Ger\"{a}t.
553 \end{enumerate}
554
555 Es gibt zwei M\"{o}glichkeiten ein bestehendes Bacula-label zu \"{u}berschreiben.
556 Die brutale Methode ist es, einfach ein EOF an den Anfang des Volumes zu schreiben
557 (dabei wird das bestehende label durch das EOF \"{u}berschrieben).
558 Mit dem Programm {\bf mt} k\"{o}nnen Sie das zum Beispiel so tun:
559
560 \footnotesize
561 \begin{verbatim}
562  [user@host]$  mt -f /dev/st0 rewind
563  [user@host]$  mt -f /dev/st0 weof
564 \end{verbatim}
565 \normalsize
566
567 Ein Festplatten-Volume k\"{o}nnen Sie auch manuell l\"{o}schen.
568
569 Danach benutzten Sie das label-Kommando, um ein neues label zu erzeugen.
570 Allerdings kann diese Vorgehensweise Spuren des alten Volumes in der
571 Katalog-Datenbank hinterlassen.
572
573 Die bevorzugte Methode ein Volume neu zu labeln sollte es sein,
574 zuerst das Volume als bereinigt (purged) zu markieren. Das passiert entweder automatisch,
575 wenn die Aufbewahrungszeit (Volume-Retention) f\"{u}r das Volume abl\"{a}uft,
576 oder kann aber auch mit dem {\bf purge}-Kommando erzwungen werden.
577 Danach k\"{o}nnen Sie das {\bf relabel}-Kommando, wie weiter unten beschrieben, verwenden.
578
579 Falls Ihr Autochanger Barcode-Labels unterst\"{u}tzt, k\"{o}nnen Sie
580 alle Volumes im Autochanger, eins nach dem anderen, mit dem Kommando
581 {\bf label barcodes} labeln. Dabei wird jedes Tape mit Barcode nacheinander
582 im Laufwerk gemountet und mit der auf dem Barcode enthaltenen Zeichenfolge
583 als Namen gelabelt. Ein entsprechender Katalog-Eintrag wird automatisch
584 mit erzeugt. Jedes Volume mit einem Barcode der mit den Zeichen beginnt,
585 die im Pool-Eintrag als CleaningPrefix konfiguriert sind, wird wie ein
586 Reinigungsband behandelt und nicht gelabelt. Allerdings wird dabei auch
587 ein Katalog-Eintrag f\"{u}r das Reinigungsband erstellt.
588
589 Als Beispiel, mit dem Eintrag:
590 \footnotesize
591 \begin{verbatim}
592         Pool {
593           Name ...
594           Cleaning Prefix = "CLN"
595        }
596 \end{verbatim}
597 \normalsize
598
599 wird jedes Tape, dessen Barcode mit CLN beginnt, als Reinigungsband betrachtet
600 und nicht automatisch gemountet.
601 Das label-Kommando kann folgenderma{\ss}en aufgerufen werden:
602
603 \footnotesize
604 \begin{verbatim}
605 label storage=xxx pool=yyy slots=1-5,10 barcodes
606 \end{verbatim}
607 \normalsize
608
609 \item [list]
610    \index[general]{list}
611    Das list-Kommando zeigt den angegebenen Inhalt der Katalog-Datenbank an.
612    Die verschiedenen Felder jedes Eintrags werden in einer Zeile ausgegeben.
613    Die verschiedenen M\"{o}glichkeiten sind:
614 \footnotesize
615 \begin{verbatim}
616    list jobs
617    
618    list jobid=<id>           (zeigt jobid <id> an)
619
620    list ujobid<unique job name> (zeigt den job mit dem Namen <unique job name> an)
621    
622    list job=<job-name>   (zeigt alle Jobs mit dem Namen <job-name> an)
623
624    list jobname=<job-name>  (identisch mit dem oberen)
625
626                 Im oberen Beispiel k\"{o}nnen Sie auch den Parameter limit=nn
627                 hinzuf\"{u}gen, um die Ausgabe des Kommandos auf nn Jobs zu begrenzen
628    
629    list jobmedia
630    
631    list jobmedia jobid=<id>
632    
633    list jobmedia job=<job-name>
634    
635    list files jobid=<id>
636    
637    list files job=<job-name>
638    
639    list pools
640    
641    list clients
642    
643    list jobtotals
644    
645    list volumes
646    
647    list volumes jobid=<id>
648    
649    list volumes pool=<pool-name>
650    
651    list volumes job=<job-name>
652    
653    list volume=<volume-name>  
654
655    list nextvolume job=<job-name>
656    
657    list nextvol job=<job-name>
658
659    list nextvol job=<job-name> days=nnn
660
661 \end{verbatim}
662 \normalsize
663
664    Die meisten der oben genannten Parameter sollten selbsterkl\"{a}rend sein.
665    \"{U}blicherweise werden Sie, falls Sie nicht gen\"{u}gend Parameter angeben,
666    von der Console nach den fehlenden Informationen gefragt.
667
668    Das {\bf list nextvol}-Kommando gibt den Volume-Namen aus, der von dem angegebenen Job
669    beim n\"{a}chsten Backup benutzt werden wird. Allerdings sollten Sie beachten, dass
670    das tats\"{a}chlich benutzte Volume von einer Reihe von Faktoren, wie zum Beispiel
671    von den vorher laufenden Jobs oder der Zeit wann der Job l\"{a}uft, abh\"{a}ngen kann.
672    Eventuell wird ein Tape schon voll sein, das aber noch freien Platz hatte, als Sie
673    das Kommando ausf\"{u}hrten. Dieses Kommando gibt Ihnen also nur einen Hinweis darauf,
674    welches Tape benutzt werden k\"{o}nnte, aber es kann keine definitive Aussage dar\"{u}ber treffen.
675    Zus\"{a}tzlich kann dieses Kommando mehrere Seiteneffekte haben, da es den selben
676    Algorithmus durchl\"{a}uft, wie ein echter Backup-Job. Das bedeutet, dass es dazu f\"{u}hren kann,
677    dass aufgrund dieses Kommandos Volumes automatisch recycled oder gelöscht (purged) werden.
678    Standardm\"{a}{\ss}ig muss der angegebene Job innerhalb der n\"{a}chsten zwei Tage laufen,
679    ansonsten wird kein Volume f\"{u}r den Job gefunden. Allerdings k\"{o}nnen Sie durch Angabe des Parameters
680    {\bf days=nnn} bis zu 50 Tage in die Zukunft angeben, die das Kommando in die Berechnung
681    mit einbeziehen soll. Falls Sie, zum Beispiel, Freitags sehen wollen, welches Volume am Montag
682    vorrausssichtlich benutzt wird, k\"{o}nnen Sie folgendes Kommando benutzen:
683    {\bf list nextvol job=MyJob days=3}.
684
685    Wenn Sie bestimmte, von Ihnen \"{o}fter ben\"{o}tigte, eigene Kommandos anlegen wollen
686    um sich bestimmte Inhalte der Katalog-Datenbank anzeigen zu lassen,
687    k\"{o}nnen Sie diese der Datei {\bf query.sql} hinzu\"{u}gen. Allerdings
688    erfordert das einiges an Wissen \"{u}ber SQL-Kommandos. Lesen Sie dazu bitte
689    den Abschnitt \"{u}ber das {\bf query}-Kommando in diesem Kapitel.
690
691    Weiter unten finden Sie auch eine Beispiel-Ausgabe des {\bf llist}-Kommandos,
692    das Ihnen den kompletten Inhalt des Katalogs zu einem bestimmten Konfigurations-Eintrag
693    anzeigt.
694
695    Als ein Beispiel, kann Ihnen der Aufruf des Kommandos {\bf list pools} die folgenden
696    Ausgaben anzeigen:
697
698 \footnotesize
699 \begin{verbatim}
700 +------+---------+---------+---------+----------+-------------+
701 | PoId | Name    | NumVols | MaxVols | PoolType | LabelFormat |
702 +------+---------+---------+---------+----------+-------------+
703 |    1 | Default |       0 |       0 | Backup   | *           |
704 |    2 | Recycle |       0 |       8 | Backup   | File        |
705 +------+---------+---------+---------+----------+-------------+
706 \end{verbatim}
707 \normalsize
708
709    As mentioned above, the {\bf list} command lists what is in the
710    database.  Some things are put into the database immediately when Bacula
711    starts up, but in general, most things are put in only when they are
712    first used, which is the case for a Client as with Job records, etc.
713
714    Bacula should create a client record in the database the first time you
715    run a job for that client.  Doing a {\bf status} will not cause a
716    database record to be created.  The client database record will be
717    created whether or not the job fails, but it must at least start.  When
718    the Client is actually contacted, additional info from the client will
719    be added to the client record (a "uname -a" output).
720
721    If you want to see what Client resources you have available in your conf
722    file, you use the Console command {\bf show clients}.
723
724 \item [llist]
725    \index[general]{llist}
726    The llist or "long list" command takes all the same arguments that the
727    list command described above does.  The difference is that the llist
728    command list the full contents of each database record selected.  It
729    does so by listing the various fields of the record vertically, with one
730    field per line.  It is possible to produce a very large number of output
731    lines with this command.
732
733    If instead of the {\bf list pools} as in the example above, you enter
734    {\bf llist pools} you might get the following output:
735
736 \footnotesize
737 \begin{verbatim}
738           PoolId: 1
739             Name: Default
740          NumVols: 0
741          MaxVols: 0
742          UseOnce: 0
743       UseCatalog: 1
744  AcceptAnyVolume: 1
745     VolRetention: 1,296,000
746   VolUseDuration: 86,400
747       MaxVolJobs: 0
748      MaxVolBytes: 0
749        AutoPrune: 0
750          Recycle: 1
751         PoolType: Backup
752      LabelFormat: *
753
754           PoolId: 2
755             Name: Recycle
756          NumVols: 0
757          MaxVols: 8
758          UseOnce: 0
759       UseCatalog: 1
760  AcceptAnyVolume: 1
761     VolRetention: 3,600
762   VolUseDuration: 3,600
763       MaxVolJobs: 1
764      MaxVolBytes: 0
765        AutoPrune: 0
766          Recycle: 1
767         PoolType: Backup
768      LabelFormat: File
769       
770 \end{verbatim}
771 \normalsize
772
773 \item [messages]
774    \index[general]{messages}
775    This command causes any pending  console messages to be immediately displayed.
776  
777
778 \item [mount]
779    \index[general]{mount}
780    The mount command is used to get Bacula to read a volume on a physical
781    device.  It is a way to tell Bacula that you have mounted a tape and
782    that Bacula should examine the tape.  This command is normally
783    used only after there was no Volume in a drive and Bacula requests you to mount a new
784    Volume or when you have specifically unmounted a Volume with the {\bf
785    unmount} console command, which causes Bacula to close the drive.  If
786    you have an autoloader, the mount command will not cause Bacula to
787    operate the autoloader unless you specify a {\bf slot} and possibly a
788    {\bf drive}. The various forms of the mount command are:
789
790 mount  storage=\lt{}storage-name\gt{} [ slot=\lt{}num\gt{} ] [
791        drive=\lt{}num\gt{} ]
792
793 mount [ jobid=\lt{}id\gt{} |  job=\lt{}job-name\gt{} ]
794
795    If you have specified {\bf Automatic  Mount = yes} in the Storage daemon's
796    Device resource,  under most circumstances, Bacula will automatically access 
797    the Volume unless you have explicitly {\bf unmount}ed it in  the Console
798    program. 
799
800 \item[python]
801    \index[general]{python}
802   The python command takes a single argument {\bf restart}:
803
804 python restart
805
806    This causes the Python interpreter in the Director to be reinitialized.
807    This can be helpful for testing because once the Director starts and the
808    Python interpreter is initialized, there is no other way to make it
809    accept any changes to the startup script {\bf DirStartUp.py}.  For more
810    details on Python scripting, please see the \ilink{Python
811    Scripting}{PythonChapter} chapter of this manual.
812
813 \label{ManualPruning}
814 \item [prune]
815    \index[general]{prune}
816    The Prune command allows you to safely remove expired database records
817    from Jobs and Volumes.  This command works only on the Catalog database
818    and does not affect data written to Volumes.  In all cases, the Prune
819    command applies a retention period to the specified records.  You can
820    Prune expired File entries from Job records; you can Prune expired Job
821    records from the database, and you can Prune both expired Job and File
822    records from specified Volumes.
823
824 prune files|jobs|volume client=\lt{}client-name\gt{} 
825 volume=\lt{}volume-name\gt{}  
826
827    For a Volume to be pruned, the {\bf VolStatus} must be Full, Used, or
828    Append, otherwise the pruning will not take place.
829
830 \item [purge]
831    \index[general]{purge}
832    The Purge command will delete associated Catalog database records from
833    Jobs and Volumes without considering the retention period.  {\bf Purge}
834    works only on the Catalog database and does not affect data written to
835    Volumes.  This command can be dangerous because you can delete catalog
836    records associated with current backups of files, and we recommend that
837    you do not use it unless you know what you are doing.  The permitted
838    forms of {\bf purge} are:
839
840 purge files jobid=\lt{}jobid\gt{}|job=\lt{}job-name\gt{}|client=\lt{}client-name\gt{} 
841
842 purge jobs client=\lt{}client-name\gt{} (of all jobs)
843
844 purge volume|volume=\lt{}vol-name\gt{} (of all jobs)
845
846 For the {\bf purge} command to work on Volume Catalog database  records the
847 {\bf VolStatus}  must be Append, Full, Used, or Error.  
848
849 The actual data written to the Volume will be unaffected by  this command.  
850
851 \item [relabel]
852    \index[general]{relabel}
853    \index[general]{relabel}
854    This command is used to label physical volumes.  The full form of this
855    command is:
856
857 relabel storage=\lt{}storage-name\gt{} oldvolume=\lt{}old-volume-name\gt{}  
858     volume=\lt{}newvolume-name\gt{} 
859  
860    If you leave out any part, you will be prompted for it.  In order for
861    the Volume (old-volume-name) to be relabeled, it must be in the catalog,
862    and the volume status must be marked {\bf Purged} or {\bf Recycle}.
863    This happens automatically as a result of applying retention periods, or
864    you may explicitly purge the volume using the {\bf purge} command.
865
866    Once the volume is physically relabeled, the old data previously written
867    on the Volume is lost and cannot be recovered.
868
869 \item [release]
870    \index[general]{release}
871    This command is used to cause the Storage daemon to rewind (release) the
872    current tape in the drive, and to re-read the Volume label the next time
873    the tape is used.
874
875 release storage=\lt{}storage-name\gt{}  
876
877    After a release command, the device is still kept open by Bacula (unless
878    Always Open is set to No in the Storage Daemon's configuration) so it
879    cannot be used by another program.  However, with some tape drives, the
880    operator can remove the current tape and to insert a different one, and
881    when the next Job starts, Bacula will know to re-read the tape label to
882    find out what tape is mounted.  If you want to be able to use the drive
883    with another program (e.g.  {\bf mt}), you must use the {\bf unmount}
884    command to cause Bacula to completely release (close) the device.
885
886 \item [reload]
887   \index[general]{reload}
888   The reload command causes the Director to re-read its configuration
889   file and apply the new values. The new values will take effect     
890   immediately for all new jobs.  However, if you change schedules,
891   be aware that the scheduler pre-schedules jobs up to two hours in
892   advance, so any changes that are to take place during the next two
893   hours may be delayed.  Jobs that have already been scheduled to run
894   (i.e. surpassed their requested start time) will continue with the
895   old values.  New jobs will use the new values. Each time you issue
896   a reload command while jobs are running, the prior config values   
897   will queued until all jobs that were running before issuing
898   the reload terminate, at which time the old config values will
899   be released from memory. The Directory permits keeping up to
900   ten prior set of configurations before it will refuse a reload
901   command. Once at least one old set of config values has been
902   released it will again accept new reload commands. 
903
904    While it is possible to reload the Director's configuration on the fly,
905    even while jobs are executing, this is a complex operation and not
906    without side effects.  Accordingly, if you have to reload the Director's
907    configuration while Bacula is running, it is advisable to restart the
908    Director at the next convenient opportunity.
909
910 \label{restore_command}
911 \item [restore]
912    \index[general]{restore}
913    The restore command allows you to select one or more Jobs (JobIds) to be
914    restored using various methods.  Once the JobIds are selected, the File
915    records for those Jobs are placed in an internal Bacula directory tree,
916    and the restore enters a file selection mode that allows you to
917    interactively walk up and down the file tree selecting individual files
918    to be restored.  This mode is somewhat similar to the standard Unix {\bf
919    restore} program's interactive file selection mode.
920
921 restore storage=\lt{}storage-name\gt{} client=\lt{}backup-client-name\gt{} 
922   where=\lt{}path\gt{} pool=\lt{}pool-name\gt{} fileset=\lt{}fileset-name\gt{} 
923   restoreclient=\lt{}restore-client-name\gt{}
924   select current all done  
925
926    Where {\bf current}, if specified, tells the restore command to
927    automatically select a restore to the most current backup.  If not
928    specified, you will be prompted.  The {\bf all} specification tells the
929    restore command to restore all files.  If it is not specified, you will
930    be prompted for the files to restore.  For details of the {\bf restore}
931    command, please see the \ilink{Restore Chapter}{RestoreChapter} of this
932    manual.
933
934    The client keyword initially specifies the client from which the backup
935    was made and the client to which the restore will be make.  However,
936    if the restoreclient keyword is specified, then the restore is written
937    to that client.
938
939 \item [run]
940    \index[general]{run}
941    This command allows you to schedule jobs  to be run immediately. The full form
942    of the command is:
943
944 run job=\lt{}job-name\gt{} client=\lt{}client-name\gt{}
945   fileset=\lt{}FileSet-name\gt{}  level=\lt{}level-keyword\gt{}
946   storage=\lt{}storage-name\gt{}  where=\lt{}directory-prefix\gt{}
947   when=\lt{}universal-time-specification\gt{}  yes  
948
949    Any information that is needed but not specified will be listed for
950    selection, and before starting the job, you will be prompted to accept,
951    reject, or modify the parameters of the job to be run, unless you have
952    specified {\bf yes}, in which case the job will be immediately sent to
953    the scheduler.
954
955    On my system, when I enter a run command, I get the following  prompt:  
956
957 \footnotesize
958 \begin{verbatim}
959 A job name must be specified.
960 The defined Job resources are:
961      1: Matou
962      2: Polymatou
963      3: Rufus
964      4: Minimatou
965      5: Minou
966      6: PmatouVerify
967      7: MatouVerify
968      8: RufusVerify
969      9: Watchdog
970 Select Job resource (1-9):
971      
972 \end{verbatim}
973 \normalsize
974
975 If I then select number 5, I am prompted with:  
976
977 \footnotesize
978 \begin{verbatim}
979 Run Backup job
980 JobName:  Minou
981 FileSet:  Minou Full Set
982 Level:    Incremental
983 Client:   Minou
984 Storage:  DLTDrive
985 Pool:     Default
986 When:     2003-04-23 17:08:18
987 OK to run? (yes/mod/no):
988      
989 \end{verbatim}
990 \normalsize
991
992 If I now enter {\bf yes}, the Job will be run. If I enter {\bf mod},  I will
993 be presented with the following prompt.  
994
995 \footnotesize
996 \begin{verbatim}
997 Parameters to modify:
998      1: Level
999      2: Storage
1000      3: Job
1001      4: FileSet
1002      5: Client
1003      6: When
1004      7: Pool
1005 Select parameter to modify (1-7):
1006      
1007 \end{verbatim}
1008 \normalsize
1009
1010 If you wish to start a job at a later time, you can do so by setting  the When
1011 time. Use the {\bf mod} option and select {\bf When} (no. 6).  Then enter the
1012 desired start time in YYYY-MM-DD HH:MM:SS format.  
1013
1014 \item [setdebug]
1015    \index[general]{setdebug}
1016    \index[general]{setdebug}
1017    \index[general]{debugging}
1018    \index[general]{debugging Win32}
1019    \index[general]{Windows!debugging}
1020    This command is used to set the debug level in each  daemon. The form of this
1021    command is:
1022
1023 setdebug level=nn [trace=0/1 client=\lt{}client-name\gt{} | dir | director |
1024   storage=\lt{}storage-name\gt{} | all]  
1025
1026    If trace=1 is set, then tracing will be enabled, and the daemon will be
1027    placed in trace mode, which means that all debug output as set by the
1028    debug level will be directed to the file {\bf bacula.trace} in the
1029    current directory of the daemon.  Normally, tracing is needed only for
1030    Win32 clients where the debug output cannot be written to a terminal or
1031    redirected to a file.  When tracing, each debug output message is
1032    appended to the trace file.  You must explicitly delete the file when
1033    you are done.
1034
1035 \item [show]
1036    \index[general]{show}
1037    \index[general]{show}
1038    The show command will list the Director's resource records as defined in
1039    the Director's configuration file (normally {\bf bacula-dir.conf}).
1040    This command is used mainly for debugging purposes by developers.     
1041    The following keywords are accepted on the
1042    show command line: catalogs, clients, counters, devices, directors,
1043    filesets, jobs, messages, pools, schedules, storages, all, help.
1044    Please don't confuse this command
1045    with the {\bf list}, which displays the contents of the catalog.
1046
1047 \item [sqlquery]
1048    \index[general]{sqlquery}
1049    The sqlquery command puts the Console program into SQL query mode where
1050    each line you enter is concatenated to the previous line until a
1051    semicolon (;) is seen.  The semicolon terminates the command, which is
1052    then passed directly to the SQL database engine.  When the output from
1053    the SQL engine is displayed, the formation of a new SQL command begins.
1054    To terminate SQL query mode and return to the Console command prompt,
1055    you enter a period (.) in column 1.
1056
1057    Using this command, you can query the SQL catalog database directly.
1058    Note you should really know what you are doing otherwise you could
1059    damage the catalog database.  See the {\bf query} command below for
1060    simpler and safer way of entering SQL queries.
1061
1062    Depending on what database engine you are using (MySQL, PostgreSQL or
1063    SQLite), you will have somewhat different SQL commands available.  For
1064    more detailed information, please refer to the MySQL, PostgreSQL or
1065    SQLite documentation.
1066
1067 \item [status]
1068    \index[general]{status}
1069    This command will display the status of the next jobs that are scheduled
1070    during the next 24 hours as well as the status of currently
1071    running jobs.  The full form of this command is:
1072
1073 status [all | dir=\lt{}dir-name\gt{} | director | 
1074   client=\lt{}client-name\gt{} | storage=\lt{}storage-name\gt{} |
1075   days=nnn]
1076
1077    If you do a {\bf status dir}, the console will list any currently
1078    running jobs, a summary of all jobs scheduled to be run in the next 24
1079    hours, and a listing of the last ten terminated jobs with their statuses.
1080    The scheduled jobs summary will include the Volume name to be used.  You
1081    should be aware of two things: 1. to obtain the volume name, the code
1082    goes through the same code that will be used when the job runs, but it
1083    does not do pruning nor recycling of Volumes; 2.  The Volume listed is
1084    at best a guess.  The Volume actually used may be different because of
1085    the time difference (more durations may expire when the job runs) and
1086    another job could completely fill the Volume requiring a new one.
1087
1088    In the Running Jobs listing, you may find the following types of
1089    information:
1090
1091
1092 \footnotesize
1093 \begin{verbatim}
1094 2507 Catalog MatouVerify.2004-03-13_05.05.02 is waiting execution
1095 5349 Full    CatalogBackup.2004-03-13_01.10.00 is waiting for higher
1096              priority jobs to finish
1097 5348 Differe Minou.2004-03-13_01.05.09 is waiting on max Storage jobs
1098 5343 Full    Rufus.2004-03-13_01.05.04 is running
1099 \end{verbatim}
1100 \normalsize
1101
1102    Looking at the above listing from bottom to top, obviously JobId 5343
1103    (Rufus) is running.  JobId 5348 (Minou) is waiting for JobId 5343 to
1104    finish because it is using the Storage resource, hence the "waiting on
1105    max Storage jobs".  JobId 5349 has a lower priority than all the other
1106    jobs so it is waiting for higher priority jobs to finish, and finally,
1107    JobId 2508 (MatouVerify) is waiting because only one job can run at a
1108    time, hence it is simply "waiting execution"
1109
1110    If you do a {\bf status dir}, it will by default list the first
1111    occurrence of all jobs that are scheduled today and tomorrow.  If you
1112    wish to see the jobs that are scheduled in the next three days (e.g.  on
1113    Friday you want to see the first occurrence of what tapes are scheduled
1114    to be used on Friday, the weekend, and Monday), you can add the {\bf
1115    days=3} option.  Note, a {\bf days=0} shows the first occurrence of jobs
1116    scheduled today only.  If you have multiple run statements, the first
1117    occurrence of each run statement for the job will be displayed for the
1118    period specified.
1119
1120    If your job seems to be blocked, you can get a general idea of the
1121    problem by doing a {\bf status dir}, but you can most often get a 
1122    much more specific indication of the problem by doing a
1123    {\bf status storage=xxx}.  For example, on an idle test system, when
1124    I do {\bf status storage=File}, I get:
1125 \footnotesize
1126 \begin{verbatim}
1127 status storage=File
1128 Connecting to Storage daemon File at 192.168.68.112:8103
1129
1130 rufus-sd Version: 1.39.6 (24 March 2006) i686-pc-linux-gnu redhat (Stentz)
1131 Daemon started 26-Mar-06 11:06, 0 Jobs run since started.
1132
1133 Running Jobs:
1134 No Jobs running.
1135 ====
1136
1137 Jobs waiting to reserve a drive:
1138 ====
1139
1140 Terminated Jobs:
1141  JobId  Level   Files          Bytes Status   Finished        Name 
1142 ======================================================================
1143     59  Full        234      4,417,599 OK       15-Jan-06 11:54 kernsave
1144 ====
1145
1146 Device status:
1147 utochanger "DDS-4-changer" with devices:
1148    "DDS-4" (/dev/nst0)
1149 Device "DDS-4" (/dev/nst0) is mounted with Volume="TestVolume002"
1150 Pool="*unknown*"
1151     Slot 2 is loaded in drive 0.
1152     Total Bytes Read=0 Blocks Read=0 Bytes/block=0
1153     Positioned at File=0 Block=0
1154 Device "Dummy" is not open or does not exist.
1155 No DEVICE structure.
1156
1157 Device "DVD-Writer" (/dev/hdc) is not open.
1158 Device "File" (/tmp) is not open.
1159 ====
1160
1161 In Use Volume status:
1162 ====
1163 \end{verbatim}
1164 \normalsize
1165
1166 Now, what this tells me is that no jobs are running and that none of
1167 the devices are in use.  Now, if I {\bf unmount} the autochanger, which
1168 will not be used in this example, and then start a Job that uses the
1169 File device, the job will block.  When I re-issue the status storage
1170 command, I get for the Device status:
1171
1172 \footnotesize
1173 \begin{verbatim}
1174 status storage=File
1175 ...
1176 Device status:
1177 Autochanger "DDS-4-changer" with devices:
1178    "DDS-4" (/dev/nst0)
1179 Device "DDS-4" (/dev/nst0) is not open.
1180     Device is BLOCKED. User unmounted.
1181     Drive 0 is not loaded.
1182 Device "Dummy" is not open or does not exist.
1183 No DEVICE structure.
1184
1185 Device "DVD-Writer" (/dev/hdc) is not open.
1186 Device "File" (/tmp) is not open.
1187     Device is BLOCKED waiting for media.
1188 ====
1189 ...
1190 \end{verbatim}
1191 \normalsize
1192
1193 Now, here it should be clear that if a job were running that wanted
1194 to use the Autochanger (with two devices), it would block because
1195 the user unmounted the device. The real problem for the Job I started
1196 using the "File" device is that the device is blocked waiting for
1197 media -- that is Bacula needs you to label a Volume.
1198
1199 \item [unmount]
1200    \index[general]{unmount}
1201    This command causes the indicated Bacula Storage  daemon to unmount the
1202    specified device. The forms of the command  are the same as the mount command:
1203 \footnotesize
1204 \begin{verbatim}
1205 unmount storage=<storage-name> [ drive=<num> ]
1206
1207 unmount [ jobid=<id> | job=<job-name> ]
1208 \end{verbatim}
1209 \normalsize
1210
1211    Once you unmount a storage device, Bacula will no longer be able to use
1212    it until you issue a mount command for that device. If Bacula needs to
1213    access that device, it will block and issue mount requests periodically
1214    to the operator.
1215
1216    If the device you are unmounting is an autochanger, it will unload
1217    the drive you have specified on the command line. If no drive is 
1218    specified, it will assume drive 1.
1219
1220 \label{UpdateCommand}
1221 \item [update]
1222    \index[general]{update}
1223    This command will update the catalog for either a specific Pool record, a Volume
1224    record, or the Slots in an  autochanger with barcode capability. In the case
1225    of updating a  Pool record, the new information will be automatically taken
1226    from  the corresponding Director's configuration resource record. It  can be
1227    used to increase the maximum number of volumes permitted or  to set a maximum
1228    number of volumes. The following main  keywords may be specified:  
1229 \footnotesize
1230 \begin{verbatim}
1231    media, volume, pool, slots  
1232 \end{verbatim}
1233 \normalsize
1234
1235 In the case of updating a  Volume, you will be prompted for which value you
1236 wish to change.  The following Volume parameters may be changed:  
1237
1238 \footnotesize
1239 \begin{verbatim}
1240  
1241    Volume Status
1242    Volume Retention Period
1243    Volume Use Duration
1244    Maximum Volume Jobs
1245    Maximum Volume Files
1246    Maximum Volume Bytes
1247    Recycle Flag
1248    Recycle Pool
1249    Slot
1250    InChanger Flag
1251    Pool
1252    Volume Files
1253    Volume from Pool
1254    All Volumes from Pool
1255    All Volumes from all Pools
1256    
1257 \end{verbatim}
1258 \normalsize
1259
1260    For slots {\bf update slots}, Bacula will obtain a list of slots and
1261    their barcodes from the Storage daemon, and for each barcode found, it
1262    will automatically update the slot in the catalog Media record to
1263    correspond to the new value.  This is very useful if you have moved
1264    cassettes in the magazine, or if you have removed the magazine and
1265    inserted a different one.  As the slot of each Volume is updated, the
1266    InChanger flag for that Volume will also be set, and any other Volumes
1267    in the Pool that were last mounted on the same Storage device
1268    will have their InChanger flag turned off.  This permits
1269    Bacula to know what magazine (tape holder) is currently in the
1270    autochanger.
1271
1272    If you do not have barcodes, you can accomplish the same thing in
1273    version 1.33 and later by using the {\bf update slots scan} command.
1274    The {\bf scan} keyword tells Bacula to physically mount each tape and to
1275    read its VolumeName.
1276
1277    For Pool {\bf update pool}, Bacula will move the Volume record from its
1278    existing pool to the pool specified.
1279
1280    For {\bf Volume from Pool}, {\bf All Volumes from Pool} and {\bf All Volumes
1281      from all Pools}, the following values are updated from the Pool record:
1282    Recycle, RecyclePool, VolRetention, VolUseDuration, MaxVolJobs, MaxVolFiles,
1283    and MaxVolBytes.  (RecyclePool feature is available with bacula 2.1.4 or
1284    higher.)
1285
1286    The full form of the update command with all command line arguments is:
1287
1288 \footnotesize
1289 \begin{verbatim}
1290        update volume=xxx pool=yyy slots volstatus=xxx VolRetention=ddd
1291          VolUse=ddd MaxVolJobs=nnn MaxVolBytes=nnn Recycle=yes|no
1292          slot=nnn enabled=n recyclepool=zzz
1293       
1294 \end{verbatim}
1295 \normalsize
1296
1297 \item [use]
1298    \index[general]{use}
1299    This command allows you to specify which Catalog  database to use. Normally,
1300 you will be using only one database so  this will be done automatically. In
1301 the case that you are using  more than one database, you can use this command
1302 to switch from  one to another.  
1303
1304 use \lt{}database-name\gt{} 
1305
1306 \item [var]
1307    \label{var}
1308    \index[general]{var name}
1309    This command takes a string or quoted string and  does variable expansion on
1310    it the same way variable expansion  is done on the {\bf LabelFormat} string.
1311    Thus, for the  most part, you can test your LabelFormat strings. The
1312    difference  between the {\bf var} command and the actual LabelFormat process 
1313    is that during the var command, no job is running so "dummy"  values are
1314    used in place of Job specific variables. Generally,  however, you will get a
1315    good idea of what is going to happen  in the real case.  
1316
1317 \item [version]
1318    \index[general]{version}
1319    The command prints the Director's version.  
1320
1321 \item [quit]
1322    \index[general]{quit}
1323    This command terminates the console program. The  console program sends the
1324    {\bf quit} request to the Director  and waits for acknowledgment. If the
1325    Director is busy doing  a previous command for you that has not terminated, it
1326    may  take some time. You may quit immediately by issuing the  {\bf .quit}
1327    command (i.e. quit preceded by a period).  
1328
1329 \item [query]
1330    \index[general]{query}
1331    This command reads a predefined SQL query from  the query file (the name and
1332    location of the  query file is defined with the QueryFile resource record in 
1333    the Director's configuration file). You are prompted to select  a query from
1334    the file, and possibly enter one or more parameters,  then the command is
1335    submitted to the Catalog database SQL engine.  
1336
1337 The following queries are currently available (version 1.24):  
1338
1339 \footnotesize
1340 \begin{verbatim}
1341 Available queries:
1342   1: List Job totals:
1343   2: List where a file is saved:
1344   3: List where the most recent copies of a file are saved:
1345   4: List total files/bytes by Job:
1346   5: List total files/bytes by Volume:
1347   6: List last 20 Full Backups for a Client:
1348   7: List Volumes used by selected JobId:
1349   8: List Volumes to Restore All Files:
1350   9: List where a File is saved:
1351 Choose a query (1-9):
1352       
1353 \end{verbatim}
1354 \normalsize
1355
1356 \item [exit]
1357    \index[general]{exit}
1358    This command terminates the console program.  
1359
1360 \item [wait]
1361    \index[general]{wait}
1362    The wait command causes the Director to pause  until there are no jobs
1363    running. This command is useful in  a batch situation such as regression
1364    testing where you  wish to start a job and wait until that job completes 
1365    before continuing. This command now has the following options:
1366 \footnotesize
1367 \begin{verbatim}
1368    wait [jobid=nn] [jobuid=unique id] [job=job name]
1369 \end{verbatim}
1370 \normalsize
1371    If specified with a specific JobId, ... the wait command will wait
1372    for that particular job to terminate before continuing.
1373
1374 \end{description}
1375
1376 \label{dotcommands}
1377 \section{Special dot Commands}
1378 \index[general]{Commands!Special dot}
1379 \index[general]{Special dot Commands}
1380
1381 There is a list of commands that are prefixed with a period (.). These
1382 commands are intended to be used either by batch programs or graphical user
1383 interface front-ends. They are not normally used by interactive users. Once
1384 GUI development begins, this list will be considerably expanded. The following
1385 is the list of dot commands: 
1386
1387 \footnotesize
1388 \begin{verbatim}
1389 .backups job=xxx      list backups for specified job
1390 .clients              list all client names
1391 .defaults client=xxx fileset=yyy  list defaults for specified client
1392 .die                  cause the Director to segment fault (for debugging)
1393 .dir                  when in tree mode prints the equivalent to the dir command,
1394                         but with fields separated by commas rather than spaces.
1395 .exit                 quit
1396 .filesets             list all fileset names
1397 .help                 help command output
1398 .jobs                 list all job names
1399 .levels               list all levels
1400 .messages             get quick messages
1401 .msgs                 return any queued messages
1402 .pools                list all pool names
1403 .quit                 quit
1404 .status               get status output
1405 .storage              return storage resource names
1406 .types                list job types
1407 \end{verbatim}
1408 \normalsize
1409
1410 \label{atcommands}
1411
1412 \section{Special At (@) Commands}
1413 \index[general]{Commands!Special At @}
1414 \index[general]{Special At (@) Commands}
1415
1416 Normally, all commands entered to the Console program are immediately
1417 forwarded to the Director, which may be on another machine, to be executed.
1418 However, there is a small list of {\bf at} commands, all beginning with an at
1419 character (@), that will not be sent to the Director, but rather interpreted
1420 by the Console program directly. Note, these commands are implemented only in
1421 the tty console program and not in the GNOME Console. These commands are: 
1422
1423 \begin{description}
1424
1425 \item [@input \lt{}filename\gt{}]
1426    \index[general]{@input \lt{}filename\gt{}}
1427    Read and execute the commands  contained in the file specified.  
1428
1429 \item [@output \lt{}filename\gt{} w/a]
1430    \index[general]{@output \lt{}filename\gt{} w/a}
1431    Send all following output to the  filename specified either overwriting the
1432 file (w) or appending to  the file (a). To redirect the output to the
1433 terminal, simply enter  {\bf @output} without a filename specification.
1434 WARNING: be careful  not to overwrite a valid file. A typical example during a
1435 regression  test might be:  
1436
1437 \footnotesize
1438 \begin{verbatim}
1439     @output /dev/null
1440     commands ...
1441     @output
1442     
1443 \end{verbatim}
1444 \normalsize
1445
1446 \item [@tee \lt{}filename\gt{} w/a]
1447    \index[general]{@tee \lt{}filename\gt{} w/a}
1448    Send all subsequent output to  both the specified file and the terminal. It is
1449    turned off by  specifying {\bf @tee} or {\bf @output} without a filename.  
1450
1451 \item [@sleep \lt{}seconds\gt{}]
1452    \index[general]{@sleep \lt{}seconds\gt{}}
1453    Sleep the specified number of seconds.  
1454
1455 \item [@time]
1456    \index[general]{@time}
1457    Print the current time and date.  
1458
1459 \item [@version]
1460    \index[general]{@version}
1461    Print the console's version.  
1462
1463 \item [@quit]
1464    \index[general]{@quit}
1465    quit  
1466
1467 \item [@exit]
1468    \index[general]{@exit}
1469    quit  
1470
1471 \item [@\# anything]
1472    \index[general]{anything}
1473    Comment 
1474 \end{description}
1475
1476 \label{scripting}
1477
1478 \section{Running the Console from a Shell Script}
1479 \index[general]{Script!Running the Console Program from a Shell}
1480 \index[general]{Running the Console Program from a Shell Script}
1481
1482 You can automate many Console tasks by running the console program from a
1483 shell script. For example, if you have created a file containing the following
1484 commands: 
1485
1486 \footnotesize
1487 \begin{verbatim}
1488  ./bconsole -c ./bconsole.conf <<END_OF_DATA
1489  unmount storage=DDS-4
1490  quit
1491  END_OF_DATA
1492 \end{verbatim}
1493 \normalsize
1494
1495 when that file is executed, it will unmount the current DDS-4 storage device.
1496 You might want to run this command during a Job by using the {\bf
1497 RunBeforeJob} or {\bf RunAfterJob} records. 
1498
1499 It is also possible to run the Console program from file input where the file
1500 contains the commands as follows: 
1501
1502 \footnotesize
1503 \begin{verbatim}
1504 ./bconsole -c ./bconsole.conf <filename
1505 \end{verbatim}
1506 \normalsize
1507
1508 where the file named {\bf filename} contains any set of console commands. 
1509
1510 As a real example, the following script is part of the Bacula regression
1511 tests. It labels a volume (a disk volume), runs a backup, then does a restore
1512 of the files saved. 
1513
1514 \footnotesize
1515 \begin{verbatim}
1516 bin/bconsole -c bin/bconsole.conf <<END_OF_DATA
1517 @output /dev/null
1518 messages
1519 @output /tmp/log1.out
1520 label volume=TestVolume001
1521 run job=Client1 yes
1522 wait
1523 messages
1524 @#
1525 @# now do a restore
1526 @#
1527 @output /tmp/log2.out
1528 restore current all
1529 yes
1530 wait
1531 messages
1532 @output
1533 quit
1534 END_OF_DATA
1535 \end{verbatim}
1536 \normalsize
1537
1538 The output from the backup is directed to /tmp/log1.out and the output from
1539 the restore is directed to /tmp/log2.out. To ensure that the backup and
1540 restore ran correctly, the output files are checked with: 
1541
1542 \footnotesize
1543 \begin{verbatim}
1544 grep "^Termination: *Backup OK" /tmp/log1.out
1545 backupstat=$?
1546 grep "^Termination: *Restore OK" /tmp/log2.out
1547 restorestat=$?
1548 \end{verbatim}
1549 \normalsize
1550
1551 \section{Adding Volumes to a Pool}
1552 \index[general]{Adding Volumes to a Pool}
1553 \index[general]{Pool!Adding Volumes to a}
1554
1555 If you have used the {\bf label} command to label a Volume, it will be
1556 automatically added to the Pool, and you will not need to add any media to the
1557 pool. 
1558
1559 Alternatively, you may choose to add a number of Volumes to the pool without
1560 labeling them. At a later time when the Volume is requested by {\bf Bacula}
1561 you will need to label it. 
1562
1563 Before adding a volume, you must know the following information: 
1564
1565 \begin{enumerate}
1566 \item The name of the Pool (normally "Default")  
1567 \item The Media Type as specified in the Storage Resource  in the Director's
1568    configuration file (e.g. "DLT8000")  
1569 \item The number and names of the Volumes you wish to create. 
1570 \end{enumerate}
1571
1572 For example, to add media to a Pool, you would issue the following commands to
1573 the console program: 
1574
1575 \footnotesize
1576 \begin{verbatim}
1577 *add
1578 Enter name of Pool to add Volumes to: Default
1579 Enter the Media Type: DLT8000
1580 Enter number of Media volumes to create. Max=1000: 10
1581 Enter base volume name: Save
1582 Enter the starting number: 1
1583 10 Volumes created in pool Default
1584 *
1585 \end{verbatim}
1586 \normalsize
1587
1588 To see what you have added, enter: 
1589
1590 \footnotesize
1591 \begin{verbatim}
1592 *list media pool=Default
1593 +-------+----------+---------+---------+-------+------------------+
1594 | MedId | VolumeNa | MediaTyp| VolStat | Bytes | LastWritten      |
1595 +-------+----------+---------+---------+-------+------------------+
1596 |    11 | Save0001 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
1597 |    12 | Save0002 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
1598 |    13 | Save0003 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
1599 |    14 | Save0004 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
1600 |    15 | Save0005 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
1601 |    16 | Save0006 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
1602 |    17 | Save0007 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
1603 |    18 | Save0008 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
1604 |    19 | Save0009 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
1605 |    20 | Save0010 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
1606 +-------+----------+---------+---------+-------+------------------+
1607 *
1608 \end{verbatim}
1609 \normalsize
1610
1611 Notice that the console program automatically appended a number to the base
1612 Volume name that you specify (Save in this case). If you don't want it to
1613 append a number, you can simply answer 0 (zero) to the question "Enter number
1614 of Media volumes to create. Max=1000:", and in this case, it will create a
1615 single Volume with the exact name you specify.