1.. _section-bconsole:
2
3Bareos Console
4==============
5
6:index:`\ <single: Bareos Console>`\  :index:`\ <single: bconsole>`\  :index:`\ <single: Command; bconsole>`\
7
8The Bareos Console (:command:`bconsole`) is a program that allows the user or the System Administrator, to interact with the Bareos Director daemon while the daemon is running.
9
10The current Bareos Console comes as a shell interface (TTY style). It permit the administrator or authorized users to interact with Bareos. You can determine the status of a particular job, examine the contents of the Catalog as well as perform certain tape manipulations with the Console program.
11
12Since the Console program interacts with the Director through the network, your Console and Director programs do not necessarily need to run on the same machine.
13
14In fact, a certain minimal knowledge of the Console program is needed in order for Bareos to be able to write on more than one tape, because when Bareos requests a new tape, it waits until the user, via the Console program, indicates that the new tape is mounted.
15
16Console Configuration
17---------------------
18
19:index:`\ <single: Configuration; Console>`\  :index:`\ <single: Configuration; bconsole>`\
20
21When the Console starts, it reads a standard Bareos configuration file named bconsole.conf unless you specify the -c command line option (see below). This file allows default configuration of the Console, and at the current time, the only Resource Record defined is the Director resource, which gives the Console the name and address of the Director. For more information on configuration of the Console program, please see the :ref:`Console Configuration <ConsoleConfChapter>` chapter
22of this document.
23
24Running the Console Program
25---------------------------
26
27The console program can be run with the following options:
28
29:index:`\ <single: Command Line Options>`\
30
31.. code-block:: shell-session
32   :caption: bconsole command line options
33
34   root@host:~# bconsole -?
35   Usage: bconsole [-s] [-c config_file] [-d debug_level]
36          -D <dir>    select a Director
37          -l          list Directors defined
38          -c <path>   specify configuration file or directory
39          -p <file>   specify pam credentials file
40          -o          send pam credentials over unencrypted connection
41          -d <nn>     set debug level to <nn>
42          -dt         print timestamp in debug output
43          -s          no signals
44          -u <nn>     set command execution timeout to <nn> seconds
45          -t          test - read configuration and exit
46          -xc         print configuration and exit
47          -xs         print configuration file schema in JSON format and exit
48          -?          print this message.
49
50After launching the Console program (bconsole), it will prompt you for the next command with an asterisk (*). Generally, for all commands, you can simply enter the command name and the Console program will prompt you for the necessary arguments. Alternatively, in most cases, you may enter the command followed by arguments. The general format is:
51
52
53
54::
55
56    <command> <keyword1>[=<argument1>] <keyword2>[=<argument2>] ...
57
58
59
60where command is one of the commands listed below; keyword is one of the keywords listed below (usually followed by an argument); and argument is the value. The command may be abbreviated to the shortest unique form. If two commands have the same starting letters, the one that will be selected is the one that appears first in the help listing. If you want the second command, simply spell out the full command. None of the keywords following the command may be abbreviated.
61
62For example:
63
64
65
66::
67
68   list files jobid=23
69
70
71
72will list all files saved for JobId 23. Or:
73
74
75
76::
77
78   show pools
79
80
81
82will display all the Pool resource records.
83
84The maximum command line length is limited to 511 characters, so if you are scripting the console, you may need to take some care to limit the line length.
85
86Exit the Console Program
87~~~~~~~~~~~~~~~~~~~~~~~~
88
89:index:`\ <single: Command; bconsole; exit>`\
90
91Normally, you simply enter quit or exit and the Console program will terminate. However, it waits until the Director acknowledges the command. If the Director is already doing a lengthy command (e.g. prune), it may take some time. If you want to immediately terminate the Console program, enter the .quit command.
92
93There is currently no way to interrupt a Console command once issued (i.e. Ctrl-C does not work). However, if you are at a prompt that is asking you to select one of several possibilities and you would like to abort the command, you can enter a period (.), and in most cases, you will either be returned to the main command prompt or if appropriate the previous prompt (in the case of nested prompts). In a few places such as where it is asking for a Volume name, the period will be taken to be the
94Volume name. In that case, you will most likely be able to cancel at the next prompt.
95
96Running the Console from a Shell Script
97~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
98
99:index:`\ <single: Console; Running from a Shell>`\
100
101.. _scripting:
102
103
104
105You can automate many Console tasks by running the console program from a shell script. For example, if you have created a file containing the following commands:
106
107
108
109::
110
111    bconsole -c ./bconsole.conf <<END_OF_DATA
112    unmount storage=DDS-4
113    quit
114    END_OF_DATA
115
116
117
118when that file is executed, it will unmount the current DDS-4 storage device. You might want to run this command during a Job by using the RunBeforeJob or RunAfterJob records.
119
120It is also possible to run the Console program from file input where the file contains the commands as follows:
121
122
123
124::
125
126   bconsole -c ./bconsole.conf <filename
127
128
129
130where the file named filename contains any set of console commands.
131
132As a real example, the following script is part of the Bareos regression tests. It labels a volume (a disk volume), runs a backup, then does a restore of the files saved.
133
134
135
136::
137
138   bconsole <<END_OF_DATA
139   @output /dev/null
140   messages
141   @output /tmp/log1.out
142   label volume=TestVolume001
143   run job=Client1 yes
144   wait
145   messages
146   @#
147   @# now do a restore
148   @#
149   @output /tmp/log2.out
150   restore current all
151   yes
152   wait
153   messages
154   @output
155   quit
156   END_OF_DATA
157
158
159
160The output from the backup is directed to /tmp/log1.out and the output from the restore is directed to /tmp/log2.out. To ensure that the backup and restore ran correctly, the output files are checked with:
161
162
163
164::
165
166   grep "^ *Termination: *Backup OK" /tmp/log1.out
167   backupstat=$?
168   grep "^ *Termination: *Restore OK" /tmp/log2.out
169   restorestat=$?
170
171
172
173Console Keywords
174----------------
175
176:index:`\ <single: Console; Keywords>`\
177
178Unless otherwise specified, each of the following keywords takes an argument, which is specified after the keyword following an equal sign. For example:
179
180::
181
182   jobid=536
183
184all
185   Permitted on the status and show commands to specify all components or resources respectively.
186
187allfrompool
188   Permitted on the update command to specify that all Volumes in the pool (specified on the command line) should be updated.
189
190allfrompools
191   Permitted on the update command to specify that all Volumes in all pools should be updated.
192
193before
194   Used in the restore command.
195
196bootstrap
197   Used in the restore command.
198
199catalog
200   Allowed in the use command to specify the catalog name to be used.
201
202catalogs
203   Used in the show command. Takes no arguments.
204
205client | fd
206   Used to specify a client (or filedaemon).
207
208clients
209   Used in the show, list, and llist commands. Takes no arguments.
210
211counters
212   Used in the show command. Takes no arguments.
213
214current
215   Used in the restore command. Takes no argument.
216
217days
218   Used to define the number of days the :bcommand:`list nextvol` command should consider when looking for jobs to be run. The days keyword can also be used on the :bcommand:`status dir` command so that it will display jobs scheduled for the number of days you want. It can also be used on the :bcommand:`rerun` command, where it will automatically select all failed jobids in the last number of days for rerunning.
219
220devices
221   Used in the show command. Takes no arguments.
222
223director | dir | directors
224   Used in the show and status command. Takes no arguments.
225
226directory
227   Used in the restore command. Its argument specifies the directory to be restored.
228
229enabled
230   This keyword can appear on the :bcommand:`update volume` as well as the :bcommand:`update slots` commands, and can allows one of the following arguments: yes, true, no, false, archived, 0, 1, 2. Where 0 corresponds to no or false, 1 corresponds to yes or true, and 2 corresponds to archived. Archived volumes will not be used, nor will the Media record in the catalog be pruned. Volumes that are not enabled, will not be used for backup or restore.
231
232done
233   Used in the restore command. Takes no argument.
234
235file
236   Used in the restore command.
237
238files
239   Used in the list and llist commands. Takes no arguments.
240
241fileset
242   Used in the run and restore command. Specifies the fileset.
243
244filesets
245   Used in the show command. Takes no arguments.
246
247help
248   Used in the show command. Takes no arguments.
249
250hours
251   Used on the :bcommand:`rerun` command to select all failed jobids in the last number of hours for rerunning.
252
253jobs
254   Used in the show, list and llist commands. Takes no arguments.
255
256jobmedia
257   Used in the list and llist commands. Takes no arguments.
258
259jobtotals
260   Used in the list and llist commands. Takes no arguments.
261
262jobid
263   The JobId is the numeric jobid that is printed in the Job Report output. It is the index of the database record for the given job. While it is unique for all the existing Job records in the catalog database, the same JobId can be reused once a Job is removed from the catalog. Probably you will refer specific Jobs that ran using their numeric JobId.
264
265   JobId can be used on the :bcommand:`rerun` command to select all jobs failed after and including the given jobid for rerunning.
266
267job | jobname
268   The Job or Jobname keyword refers to the name you specified in the Job resource, and hence it refers to any number of Jobs that ran. It is typically useful if you want to list all jobs of a particular name.
269
270level
271   Used in the run command. Specifies the backup level.
272
273listing
274   Permitted on the estimate command. Takes no argument.
275
276limit
277   Specifies the maximum number of items in the result.
278
279messages
280   Used in the show command. Takes no arguments.
281
282media
283   Used in the list and llist commands. Takes no arguments.
284
285nextvolume | nextvol
286   Used in the list and llist commands. Takes no arguments.
287
288on
289   Takes no arguments.
290
291off
292   Takes no arguments.
293
294pool
295   Specify the pool to be used.
296
297pools
298   Used in the show, list, and llist commands. Takes no arguments.
299
300select
301   Used in the restore command. Takes no argument.
302
303limit
304   Used in the setbandwidth command. Takes integer in KB/s unit.
305
306schedules
307   Used in the show command. Takes no arguments.
308
309storage | store | sd
310   Used to specify the name of a storage daemon.
311
312storages
313   Used in the show command. Takes no arguments.
314
315ujobid
316   The ujobid is a unique job identification that is printed in the Job Report output. At the current time, it consists of the Job name (from the Name directive for the job) appended with the date and time the job was run. This keyword is useful if you want to completely identify the Job instance run.
317
318volume
319   Used to specify a volume.
320
321volumes
322   Used in the list and llist commands. Takes no arguments.
323
324where
325   Used in the restore command.
326
327yes
328   Used in the restore command. Takes no argument.
329
330.. _section-ConsoleCommands:
331
332Console Commands
333----------------
334
335The following commands are currently implemented:
336
337add
338   :index:`\ <single: Console; Command; add|textbf>`\  This command is used to add Volumes to an existing Pool. That is, it creates the Volume name in the catalog and inserts into the Pool in the catalog, but does not attempt to access the physical Volume. Once added, Bareos expects that Volume to exist and to be labeled. This command is not normally used since Bareos will automatically do the equivalent when Volumes are labeled. However, there may be times when you have removed a Volume
339   from the catalog and want to later add it back.
340
341   The full form of this command is:
342
343   .. code-block:: bconsole
344      :caption: add
345
346      add [pool=<pool-name>] [storage=<storage>] [jobid=<JobId>]
347
348   Normally, the :bcommand:`label` command is used rather than this command because the :bcommand:`label` command labels the physical media (tape, disk,, ...) and does the equivalent of the :bcommand:`add` command. The :bcommand:`add` command affects only the Catalog and not the physical media (data on Volumes). The physical media must exist and be labeled before use (usually with the :bcommand:`label` command). This command
349   can, however, be useful if you wish to add a number of Volumes to the Pool that will be physically labeled at a later time. It can also be useful if you are importing a tape from another site. Please see the :bcommand:`label` command for the list of legal characters in a Volume name.
350
351autodisplay
352   :index:`\ <single: Console; Command; autodisplay on/off>`\  This command accepts on or off as an argument, and turns auto-display of messages on or off respectively. The default for the console program is off, which means that you will be notified when there are console messages pending, but they will not automatically be displayed.
353
354   When autodisplay is turned off, you must explicitly retrieve the messages with the messages command. When autodisplay is turned on, the messages will be displayed on the console as they are received.
355
356automount
357   :index:`\ <single: Console; Command; automount on/off>`\  This command accepts on or off as the argument, and turns auto-mounting of the Volume after a label command on or off respectively. The default is on. If automount is turned off, you must explicitly mount tape Volumes after a label command to use it.
358
359cancel
360   :index:`\ <single: Console; Command; cancel jobid>`\  This command is used to cancel a job and accepts jobid=nnn or job=xxx as an argument where nnn is replaced by the JobId and xxx is replaced by the job name. If you do not specify a keyword, the Console program will prompt you with the names of all the active jobs allowing you to choose one.
361
362   The full form of this command is:
363
364   .. code-block:: bconsole
365      :caption: cancel
366
367      cancel [jobid=<number> job=<job-name> ujobid=<unique-jobid>]
368
369   Once a Job is marked to be cancelled, it may take a bit of time (generally within a minute but up to two hours) before the Job actually terminates, depending on what operations it is doing. Don’t be surprised that you receive a Job not found message. That just means that one of the three daemons had already canceled the job. Messages numbered in the 1000’s are from the Director, 2000’s are from the File daemon and 3000’s from the Storage daemon.
370
371   It is possible to cancel multiple jobs at once. Therefore, the following extra options are available for the job-selection:
372
373   -  all jobs
374
375   -  all jobs with a created state
376
377   -  all jobs with a blocked state
378
379   -  all jobs with a waiting state
380
381   -  all jobs with a running state
382
383   Usage:
384
385   .. code-block:: bconsole
386      :caption: cancel all
387
388      cancel all
389      cancel all state=<created|blocked|waiting|running>
390
391   Sometimes the Director already removed the job from its running queue, but the storage daemon still thinks it is doing a backup (or another job) - so you cannot cancel the job from within a console anymore. Therefore it is possible to cancel a job by JobId on the storage daemon. It might be helpful to execute a :bcommand:`status storage` on the Storage Daemon to make sure what job you want to cancel.
392
393   Usage:
394
395   .. code-block:: bconsole
396      :caption: cancel on Storage Daemon
397
398      cancel storage=<Storage Daemon> Jobid=<JobId>
399
400   This way you can also remove a job that blocks any other jobs from running without the need to restart the whole storage daemon.
401
402create
403   :index:`\ <single: Console; Command; create pool>`\  This command is not normally used as the Pool records are automatically created by the Director when it starts based on what it finds in the configuration. If needed, this command can be used, to create a Pool record in the database using the Pool resource record defined in the Director’s configuration file. So in a sense, this command simply transfers the information from the Pool resource in the configuration file into the Catalog.
404   Normally this command is done automatically for you when the Director starts providing the Pool is referenced within a Job resource. If you use this command on an existing Pool, it will automatically update the Catalog to have the same information as the Pool resource. After creating a Pool, you will most likely use the label command to label one or more volumes and add their names to the Media database.
405
406   The full form of this command is:
407
408   .. code-block:: bconsole
409      :caption: create
410
411      create [pool=<pool-name>]
412
413   When starting a Job, if Bareos determines that there is no Pool record in the database, but there is a Pool resource of the appropriate name, it will create it for you. If you want the Pool record to appear in the database immediately, simply use this command to force it to be created.
414
415
416.. _section-bcommandConfigure:
417
418configure
419   Configures director resources during runtime. The first configure subcommands are :bcommand:`configure add` and :bcommand:`configure export`. Other subcommands may follow in later releases.
420
421   .. _section-bcommandConfigureAdd:
422
423   configure add
424      :index:`\ <single: Console; Command; configure add>`
425
426      This command allows to add resources during runtime. Usage:
427
428      .. code-block:: bconsole
429         :caption: configure add usage
430
431         configure add <resourcetype> name=<resourcename> <directive1>=<value1> <directive2>=<value2> ...
432
433      Values that must be quoted in the resulting configuration must be added as:
434
435      .. code-block:: bconsole
436         :caption: configure add usage with values containing spaces
437
438         configure add <resourcetype> name=<resourcename> <directive1>="\"<value containing spaces>\"" ...
439
440      The command generates and loads a new valid resource. As the new resource is also stored at
441
442      :file:`<CONFIGDIR>/bareos-dir.d/<resourcetype>/<resourcename>.conf`
443
444      (see :ref:`section-ConfigurationResourceFileConventions`) it is persistent upon reload and restart.
445
446      This feature requires :ref:`section-ConfigurationSubdirectories`.
447
448      All kinds of resources can be added. When adding a client resource, the :ref:`ClientResourceDirector` for the |fd| is also created and stored at:
449
450      :file:`<CONFIGDIR>/bareos-dir-export/client/<clientname>/bareos-fd.d/director/<clientname>.conf`
451
452      .. code-block:: bconsole
453         :caption: Example: adding a client and a job resource during runtime
454
455         *<input>configure add client name=client2-fd address=192.168.0.2 password=secret</input>
456         Created resource config file "/etc/bareos/bareos-dir.d/client/client2-fd.conf":
457         Client {
458           Name = client2-fd
459           Address = 192.168.0.2
460           Password = secret
461         }
462         *<input>configure add job name=client2-job client=client2-fd jobdefs=DefaultJob</input>
463         Created resource config file "/etc/bareos/bareos-dir.d/job/client2-job.conf":
464         Job {
465           Name = client2-job
466           Client = client2-fd
467           JobDefs = DefaultJob
468         }
469
470      These two commands create three resource configuration files:
471
472      - :file:`/etc/bareos/bareos-dir.d/client/client2-fd.conf`
473
474      - :file:`/etc/bareos/bareos-dir-export/client/client2-fd/bareos-fd.d/director/bareos-dir.conf` (assuming your director resource is named **bareos-dir**)
475
476      - :file:`/etc/bareos/bareos-dir.d/job/client2-job.conf`
477
478      The files in :file:`bareos-dir-export/client/` directory are not used by the |dir|. However, they can be copied to new clients to configure these clients for the |dir|.
479
480      .. warning::
481
482         Don't be confused by the extensive output of :bcommand:`help configure`. As :bcommand:`configure add` allows configuring arbitrary resources, the output of :bcommand:`help configure` lists all the resources, each with all valid directives. The same data is also used for :command:`bconsole` command line completion.
483
484      Available since Bareos :sinceVersion:`16.2.4: configure add`.
485
486
487   .. _section-bcommandConfigureExport:
488
489   configure export
490      :index:`\ <single: Console; Command; configure export>`
491
492      This command allows to export the :config:option:`Fd/Director`\  resource for clients already configured in the |dir|.
493
494      Usage:
495
496      .. code-block:: bconsole
497         :caption: Export the bareos-fd Director resource for the client bareos-fd
498
499         configure export client=bareos-fd
500         Exported resource file "/etc/bareos/bareos-dir-export/client/bareos-fd/bareos-fd.d/director/bareos-dir.conf":
501         Director {
502           Name = bareos-dir
503           Password = "[md5]932d1d3ef3c298047809119510f4bee6"
504         }
505
506      To use it, copy the :config:option:`Fd/Director`\  resource file to the client machine (on Linux: to :file:`/etc/bareos/bareos-fd.d/director/`) and restart the |fd|.
507
508      Available since Bareos :sinceVersion:`16.2.4: configure export`.
509
510delete
511   :index:`\ <single: Console; Command; delete>`\  The delete command is used to delete a Volume, Pool or Job record from the Catalog as well as all associated catalog Volume records that were created. This command operates only on the Catalog database and has no effect on the actual data written to a Volume. This command can be dangerous and we strongly recommend that you do not use it unless you know what you are doing.
512
513   If the keyword Volume appears on the command line, the named Volume will be deleted from the catalog, if the keyword Pool appears on the command line, a Pool will be deleted, and if the keyword Job appears on the command line, a Job and all its associated records (File and JobMedia) will be deleted from the catalog.
514
515   The full form of this command is:
516
517   .. code-block:: bconsole
518      :caption: delete
519
520      delete pool=<pool-name>
521      delete volume=<volume-name> pool=<pool-name>
522      delete JobId=<job-id> JobId=<job-id2> ...
523      delete Job JobId=n,m,o-r,t ...
524
525   The first form deletes a Pool record from the catalog database. The second form deletes a Volume record from the specified pool in the catalog database. The third form deletes the specified Job record from the catalog database. The last form deletes JobId records for JobIds n, m, o, p, q, r, and t. Where each one of the n,m,... is, of course, a number. That is a "delete jobid" accepts lists and ranges of jobids.
526
527disable
528   :index:`\ <single: Console; Command; disable>`\  This command permits you to disable a Job for automatic scheduling. The job may have been previously enabled with the Job resource Enabled directive or using the console enable command. The next time the Director is reloaded or restarted, the Enable/Disable state will be set to the value in the Job resource (default enabled) as defined in the |dir| configuration.
529
530   The full form of this command is:
531
532   .. code-block:: bconsole
533      :caption: disable
534
535      disable job=<job-name>
536
537enable
538   :index:`\ <single: Console; Command; enable>`\  This command permits you to enable a Job for automatic scheduling. The job may have been previously disabled with the Job resource Enabled directive or using the console disable command. The next time the Director is reloaded or restarted, the Enable/Disable state will be set to the value in the Job resource (default enabled) as defined in the |dir| configuration.
539
540   The full form of this command is:
541
542   .. code-block:: bconsole
543      :caption: enable
544
545      enable job=<job-name>
546
547
548
549.. _estimate:
550
551estimate
552   :index:`\ <single: Console; Command; estimate>`\  Using this command, you can get an idea how many files will be backed up, or if you are unsure about your Include statements in your FileSet, you can test them without doing an actual backup. The default is to assume a Full backup. However, you can override this by specifying a level=Incremental or level=Differential on the command line. A Job name must be specified or you will be prompted for one, and optionally a Client and FileSet may
553   be specified on the command line. It then contacts the client which computes the number of files and bytes that would be backed up. Please note that this is an estimate calculated from the number of blocks in the file rather than by reading the actual bytes. As such, the estimated backup size will generally be larger than an actual backup.
554
555   The ``estimate`` command can use the accurate code to detect changes and give a better estimation. You can set the accurate behavior on command line using ``accurate=yes/no`` or use the Job setting as default value.
556
557   Optionally you may specify the keyword listing in which case, all the files to be backed up will be listed. Note, it could take quite some time to display them if the backup is large. The full form is:
558
559   The full form of this command is:
560
561   .. code-block:: bconsole
562      :caption: estimate
563
564      estimate job=<job-name> listing client=<client-name> accurate=<yes|no> fileset=<fileset-name> level=<level-name>
565
566   Specification of the job is sufficient, but you can also override the client, fileset, accurate and/or level by specifying them on the estimate command line.
567
568   As an example, you might do:
569
570   .. code-block:: bconsole
571      :caption: estimate: redirected output
572
573      @output /tmp/listing
574      estimate job=NightlySave listing level=Incremental
575      @output
576
577   which will do a full listing of all files to be backed up for the Job NightlySave during an Incremental save and put it in the file /tmp/listing. Note, the byte estimate provided by this command is based on the file size contained in the directory item. This can give wildly incorrect estimates of the actual storage used if there are sparse files on your systems. Sparse files are often found on 64 bit systems for certain system files. The size that is returned is the size Bareos will backup if
578   the sparse option is not specified in the FileSet. There is currently no way to get an estimate of the real file size that would be found should the sparse option be enabled.
579
580exit
581   :index:`\ <single: Console; Command; exit>`\  This command terminates the console program.
582
583export
584   :index:`\ <single: Console; Command; export>`\  The export command is used to export tapes from an autochanger. Most Automatic Tapechangers offer special slots for importing new tape cartridges or exporting written tape cartridges. This can happen without having to set the device offline.
585
586   The full form of this command is:
587
588   .. code-block:: bconsole
589      :caption: export
590
591      export storage=<storage-name> srcslots=<slot-selection> [dstslots=<slot-selection> volume=<volume-name> scan]
592
593   The export command does exactly the opposite of the import command. You can specify which slots should be transferred to import/export slots. The most useful application of the export command is the possibility to automatically transfer the volumes of a certain backup into the import/export slots for external storage.
594
595   To be able to to this, the export command also accepts a list of volume names to be exported.
596
597   Example:
598
599   .. code-block:: bconsole
600      :caption: export volume
601
602      export volume=A00020L4|A00007L4|A00005L4
603
604   Instead of exporting volumes by names you can also select a number of slots via the srcslots keyword and export those to the slots you specify in dstslots. The export command will check if the slots have content (e.g. otherwise there is not much to export) and if there are enough export slots and if those are really import/export slots.
605
606   Example:
607
608   .. code-block:: bconsole
609      :caption: export slots
610
611      export srcslots=1-2 dstslots=37-38
612
613   To automatically export the Volumes used by a certain backup job, you can use the following RunScript in that job:
614
615   .. code-block:: bconsole
616      :caption: automatic export
617
618      RunScript {
619          Console = "export storage=TandbergT40 volume=%V"
620          RunsWhen = After
621          RunsOnClient = no
622      }
623
624   To send an e-mail notification via the Messages resource regarding export tapes you can use the Variable %V substitution in the Messages resource, which is implemented in Bareos 13.2. However, it does also work in earlier releases inside the job resources. So in versions prior to Bareos 13.2 the following workaround can be used:
625
626   .. code-block:: bconsole
627      :caption: e-mail notification via messages resource regarding export tapes
628
629      RunAfterJob = "/bin/bash -c \"/bin/echo Remove Tape %V | \
630      /usr/sbin/bsmtp -h localhost -f root@localhost -s 'Remove Tape %V' root@localhost \""
631
632gui
633   :index:`\ <single: Console; Command; gui>`\  Invoke the non-interactive gui mode. This command is only used when :command:`bconsole` is commanded by an external program.
634
635help
636   :index:`\ <single: Console; Command; help>`\  This command displays the list of commands available.
637
638import
639   :index:`\ <single: Console; Command; import>`\  The import command is used to import tapes into an autochanger. Most Automatic Tapechangers offer special slots for importing new tape cartridges or exporting written tape cartridges. This can happen without having to set the device offline.
640
641   The full form of this command is:
642
643   .. code-block:: bconsole
644      :caption: import
645
646      import storage=<storage-name> [srcslots=<slot-selection> dstslots=<slot-selection> volume=<volume-name> scan]
647
648   To import new tapes into the autochanger, you only have to load the new tapes into the import/export slots and call import from the cmdline.
649
650   The import command will automatically transfer the new tapes into free slots of the autochanger. The slots are filled in order of the slot numbers. To import all tapes, there have to be enough free slots to load all tapes.
651
652   Example with a Library with 36 Slots and 3 Import/Export Slots:
653
654   .. code-block:: bconsole
655      :caption: import example
656
657      *import storage=TandbergT40
658      Connecting to Storage daemon TandbergT40 at bareos:9103 ...
659      3306 Issuing autochanger "slots" command.
660      Device "Drive-1" has 39 slots.
661      Connecting to Storage daemon TandbergT40 at bareos:9103 ...
662      3306 Issuing autochanger "listall" command.
663      Connecting to Storage daemon TandbergT40 at bareos:9103 ...
664      3306 Issuing autochanger transfer command.
665      3308 Successfully transfered volume from slot 37 to 20.
666      Connecting to Storage daemon TandbergT40 at bareos:9103 ...
667      3306 Issuing autochanger transfer command.
668      3308 Successfully transfered volume from slot 38 to 21.
669      Connecting to Storage daemon TandbergT40 at bareos:9103 ...
670      3306 Issuing autochanger transfer command.
671      3308 Successfully transfered volume from slot 39 to 25.
672
673   You can also import certain slots when you don’t have enough free slots in your autochanger to put all the import/export slots in.
674
675   Example with a Library with 36 Slots and 3 Import/Export Slots importing one slot:
676
677   .. code-block:: bconsole
678      :caption: import example
679
680      *import storage=TandbergT40 srcslots=37 dstslots=20
681      Connecting to Storage daemon TandbergT40 at bareos:9103 ...
682      3306 Issuing autochanger "slots" command.
683      Device "Drive-1" has 39 slots.
684      Connecting to Storage daemon TandbergT40 at bareos:9103 ...
685      3306 Issuing autochanger "listall" command.
686      Connecting to Storage daemon TandbergT40 at bareos:9103 ...
687      3306 Issuing autochanger transfer command.
688      3308 Successfully transfered volume from slot 37 to 20.
689
690label
691   :index:`\ <single: Console; Command; label>`\  :index:`\ <single: Console; Command; relabel>`\  This command is used to label physical volumes. The full form of this command is:
692
693   .. code-block:: bconsole
694      :caption: label
695
696      label storage=<storage-name> volume=<volume-name> slot=<slot>
697
698   If you leave out any part, you will be prompted for it. The media type is automatically taken from the Storage resource definition that you supply. Once the necessary information is obtained, the Console program contacts the specified Storage daemon and requests that the Volume be labeled. If the Volume labeling is successful, the Console program will create a Volume record in the appropriate Pool.
699
700   The Volume name is restricted to letters, numbers, and the special characters hyphen (-), underscore (\_), colon (:), and period (.). All other characters including a space are invalid. This restriction is to ensure good readability of Volume names to reduce operator errors.
701
702   Please note, when labeling a blank tape, Bareos will get read I/O error when it attempts to ensure that the tape is not already labeled. If you wish to avoid getting these messages, please write an EOF mark on your tape before attempting to label it:
703
704
705
706   ::
707
708             mt rewind
709             mt weof
710
711
712
713   The label command can fail for a number of reasons:
714
715   #. The Volume name you specify is already in the Volume database.
716
717   #. The Storage daemon has a tape or other Volume already mounted on the device, in which case you must unmount the device, insert a blank tape, then do the label command.
718
719   #. The Volume in the device is already a Bareos labeled Volume. (Bareos will never relabel a Bareos labeled Volume unless it is recycled and you use the relabel command).
720
721   #. There is no Volume in the drive.
722
723   There are two ways to relabel a volume that already has a Bareos label. The brute force method is to write an end of file mark on the tape using the system mt program, something like the following:
724
725   ::
726
727             mt -f /dev/st0 rewind
728             mt -f /dev/st0 weof
729
730   For a disk volume, you would manually delete the Volume.
731
732   Then you use the label command to add a new label. However, this could leave traces of the old volume in the catalog.
733
734   The preferable method to relabel a Volume is to first purge the volume, either automatically, or explicitly with the :bcommand:`purge` command, then use the :bcommand:`relabel` command described below.
735
736   If your autochanger has barcode labels, you can label all the Volumes in your autochanger one after another by using the :bcommand:`label barcodes` command. For each tape in the changer containing a barcode, Bareos will mount the tape and then label it with the same name as the barcode. An appropriate Media record will also be created in the catalog. Any barcode that begins with the same characters as specified on the "CleaningPrefix=xxx" (default is "CLN") directive in the
737   Director’s Pool resource, will be treated as a cleaning tape, and will not be labeled. However, an entry for the cleaning tape will be created in the catalog. For example with:
738
739   .. code-block:: bareosconfig
740      :caption: Cleaning Tape
741
742      Pool {
743          Name ...
744          Cleaning Prefix = "CLN"
745      }
746
747   Any slot containing a barcode of CLNxxxx will be treated as a cleaning tape and will not be mounted. Note, the full form of the command is:
748
749   .. code-block:: bconsole
750      :caption: label
751
752      label storage=xxx pool=yyy slots=1-5,10 barcodes
753
754list
755   :index:`\ <single: Console; Command; list>`\  The list command lists the requested contents of the Catalog. The various fields of each record are listed on a single line. The various forms of the list command are:
756
757   .. code-block:: bconsole
758      :caption: list
759
760      list jobs
761      list jobid=<id>           (list jobid id)
762      list ujobid=<unique job name> (list job with unique name)
763      list job=<job-name>   (list all jobs with "job-name")
764      list jobname=<job-name>  (same as above)
765          In the above, you can add "limit=nn" to limit the output to nn jobs.
766      list joblog jobid=<id> (list job output if recorded in the catalog)
767      list jobmedia
768      list jobmedia jobid=<id>
769      list jobmedia job=<job-name>
770      list files jobid=<id>
771      list files job=<job-name>
772      list pools
773      list clients
774      list jobtotals
775      list volumes
776      list volumes jobid=<id>
777      list volumes pool=<pool-name>
778      list volumes job=<job-name>
779      list volume=<volume-name>
780      list nextvolume job=<job-name>
781      list nextvol job=<job-name>
782      list nextvol job=<job-name> days=nnn
783
784   What most of the above commands do should be more or less obvious. In general if you do not specify all the command line arguments, the command will prompt you for what is needed.
785
786   The :bcommand:`list nextvol` command will print the Volume name to be used by the specified job. You should be aware that exactly what Volume will be used depends on a lot of factors including the time and what a prior job will do. It may fill a tape that is not full when you issue this command. As a consequence, this command will give you a good estimate of what Volume will be used but not a definitive answer. In addition, this command may have certain side effect because it
787   runs through the same algorithm as a job, which means it may automatically purge or recycle a Volume. By default, the job specified must run within the next two days or no volume will be found. You can, however, use the days=nnn specification to specify up to 50 days. For example, if on Friday, you want to see what Volume will be needed on Monday, for job MyJob, you would use :bcommand:`list nextvol job=MyJob days=3`.
788
789   If you wish to add specialized commands that list the contents of the catalog, you can do so by adding them to the :file:`query.sql` file. However, this takes some knowledge of programming SQL. Please see the :bcommand:`query` command below for additional information. See below for listing the full contents of a catalog record with the :bcommand:`llist` command.
790
791   As an example, the command list pools might produce the following output:
792
793   .. code-block:: bconsole
794      :caption: list pools
795
796      *<input>list pools</input>
797      +------+---------+---------+---------+----------+-------------+
798      | PoId | Name    | NumVols | MaxVols | PoolType | LabelFormat |
799      +------+---------+---------+---------+----------+-------------+
800      |    1 | Default |       0 |       0 | Backup   | *           |
801      |    2 | Recycle |       0 |       8 | Backup   | File        |
802      +------+---------+---------+---------+----------+-------------+
803
804   As mentioned above, the list command lists what is in the database. Some things are put into the database immediately when Bareos starts up, but in general, most things are put in only when they are first used, which is the case for a Client as with Job records, etc.
805
806   Bareos should create a client record in the database the first time you run a job for that client. Doing a status will not cause a database record to be created. The client database record will be created whether or not the job fails, but it must at least start. When the Client is actually contacted, additional info from the client will be added to the client record (a "uname -a" output).
807
808   If you want to see what Client resources you have available in your conf file, you use the Console command show clients.
809
810llist
811   :index:`\ <single: Console; Command; llist>`\  The llist or "long list" command takes all the same arguments that the list command described above does. The difference is that the llist command list the full contents of each database record selected. It does so by listing the various fields of the record vertically, with one field per line. It is possible to produce a very large number of output lines with this command.
812
813   If instead of the list pools as in the example above, you enter llist pools you might get the following output:
814
815   .. code-block:: bconsole
816      :caption: llist pools
817
818      *<input>llist pools</input>
819                PoolId: 1
820                  Name: Default
821               NumVols: 0
822               MaxVols: 0
823               UseOnce: 0
824            UseCatalog: 1
825       AcceptAnyVolume: 1
826          VolRetention: 1,296,000
827        VolUseDuration: 86,400
828            MaxVolJobs: 0
829           MaxVolBytes: 0
830             AutoPrune: 0
831               Recycle: 1
832              PoolType: Backup
833           LabelFormat: *
834
835                PoolId: 2
836                  Name: Recycle
837               NumVols: 0
838               MaxVols: 8
839               UseOnce: 0
840            UseCatalog: 1
841       AcceptAnyVolume: 1
842          VolRetention: 3,600
843        VolUseDuration: 3,600
844            MaxVolJobs: 1
845           MaxVolBytes: 0
846             AutoPrune: 0
847               Recycle: 1
848              PoolType: Backup
849           LabelFormat: File
850
851messages
852   :index:`\ <single: Console; Command; messages>`\  This command causes any pending console messages to be immediately displayed.
853
854memory
855   :index:`\ <single: Console; Command; memory>`\  Print current memory usage.
856
857mount
858   :index:`\ <single: Console; Command; mount>`\  The mount command is used to get Bareos to read a volume on a physical device. It is a way to tell Bareos that you have mounted a tape and that Bareos should examine the tape. This command is normally used only after there was no Volume in a drive and Bareos requests you to mount a new Volume or when you have specifically unmounted a Volume with the :bcommand:`unmount` console command, which causes Bareos to close the drive. If
859   you have an autoloader, the mount command will not cause Bareos to operate the autoloader unless you specify a slot and possibly a drive. The various forms of the mount command are:
860
861   .. code-block:: bconsole
862      :caption: mount
863
864      mount storage=<storage-name> [slot=<num>] [drive=<num>]
865      mount [jobid=<id> | job=<job-name>]
866
867   If you have specified :config:option:`sd/device/AutomaticMount = yes`\ , under most circumstances, Bareos will automatically access the Volume unless you have explicitly unmounted it (in the Console program).
868
869move
870   :index:`\ <single: Console; Command; move>`\  The move command allows to move volumes between slots in an autochanger without having to leave the bconsole.
871
872   To move a volume from slot 32 to slots 33, use:
873
874   .. code-block:: bconsole
875      :caption: move
876
877      *<input>move storage=TandbergT40 srcslots=32 dstslots=33</input>
878      Connecting to Storage daemon TandbergT40 at bareos:9103 ...
879      3306 Issuing autochanger "slots" command.
880      Device "Drive-1" has 39 slots.
881      Connecting to Storage daemon TandbergT40 at bareos:9103 ...
882      3306 Issuing autochanger "listall" command.
883      Connecting to Storage daemon TandbergT40 at bareos:9103 ...
884      3306 Issuing autochanger transfer command.
885      3308 Successfully transfered volume from slot 32 to 33.
886
887
888.. _ManualPruning:
889
890prune
891   :index:`\ <single: Console; Command; prune>`
892
893   The Prune command allows you to safely remove expired database records from Jobs, Volumes and Statistics. This command works only on the Catalog database and does not affect data written to Volumes. In all cases, the Prune command applies a retention period to the specified records. You can Prune expired File entries from Job records; you can Prune expired Job records from the database, and you can Prune
894   both expired Job and File records from specified Volumes.
895
896   .. code-block:: bconsole
897      :caption: prune
898
899      prune files [client=<client>] [pool=<pool>] [yes] |
900            jobs [client=<client>] [pool=<pool>] [jobtype=<jobtype>] [yes] |
901            volume [=volume] [pool=<pool>] [yes] |
902            stats [yes]
903
904   For a Volume to be pruned, the volume status must be **Full**, **Used** or **Append** otherwise the pruning will not take place.
905
906
907.. _bcommandPurge:
908
909purge
910   :index:`\ <single: Console; Command; purge>`
911
912   The Purge command will delete associated catalog database records from Jobs and Volumes without considering the retention period. This command can be dangerous because you can delete catalog records associated with current backups of files, and we recommend that you do not use it unless you know what you are doing. The permitted forms of :bcommand:`purge` are:
913
914   .. code-block:: bconsole
915      :caption: purge
916
917      purge [files [job=<job> | jobid=<jobid> | client=<client> | volume=<volume>]] |
918            [jobs [client=<client> | volume=<volume>]] |
919            [volume [=<volume>] [storage=<storage>] [pool=<pool>] [devicetype=<type>] [drive=<drivenum>] [action=<action>]] |
920            [quota [client=<client>]]
921
922   For the :bcommand:`purge` command to work on volume catalog database records the volume status must be **Append**, **Full**, **Used** or **Error**.
923
924   The actual data written to the Volume will be unaffected by this command unless you are using the :config:option:`dir/pool/ActionOnPurge = Truncate`\  option.
925
926   To ask Bareos to truncate your **Purged** volumes, you need to use the following command in interactive mode:
927
928   .. code-block:: bconsole
929      :caption: purge example
930
931      *<input>purge volume action=truncate storage=File pool=Full</input>
932
933   However, normally you should use the :bcommand:`purge` command only to purge a volume from the catalog and use the :bcommand:`truncate` command to truncate the volume on the |sd|.
934
935
936resolve
937   :index:`\ <single: Console; Command; resolve>`\  In the configuration files, Addresses can (and normally should) be specified as DNS names. As the different components of Bareos will establish network connections to other Bareos components, it is important that DNS name resolution works on involved components and delivers the same results. The :bcommand:`resolve` command can be used to test DNS resolution of a given hostname on director, storage daemon or client.
938
939   .. code-block:: bconsole
940      :caption: resolve example
941
942      *<input>resolve www.bareos.com</input>
943      bareos-dir resolves www.bareos.com to host[ipv4:84.44.166.242]
944
945      *<input>resolve client=client1-fd www.bareos.com</input>
946      client1-fd resolves www.bareos.com to host[ipv4:84.44.166.242]
947
948      *<input>resolve storage=File www.bareos.com</input>
949      bareos-sd resolves www.bareos.com to host[ipv4:84.44.166.242]
950
951
952.. _section-bcommandQuery:
953
954query
955   :index:`\ <single: Console; Command; query>`
956   This command reads a predefined SQL query from the query file (the name and location of the query file is defined with the QueryFile resource record in the Director’s configuration file). You are prompted to select a query from the file, and possibly enter one or more parameters, then the command is submitted to the Catalog database SQL engine.
957
958quit
959   :index:`\ <single: quit>`\  This command terminates the console program. The console program sends the quit request to the Director and waits for acknowledgment. If the Director is busy doing a previous command for you that has not terminated, it may take some time. You may quit immediately by issuing the .quit command (i.e. quit preceded by a period).
960
961relabel
962   :index:`\ <single: Console; Command; relabel>`\  This command is used to label physical volumes.
963
964   The full form of this command is:
965
966   .. code-block:: bconsole
967      :caption: relabel
968
969      relabel storage=<storage-name> oldvolume=<old-volume-name> volume=<new-volume-name> pool=<pool-name> [encrypt]
970
971   If you leave out any part, you will be prompted for it. In order for the Volume (old-volume-name) to be relabeled, it must be in the catalog, and the volume status must be marked **Purged** or **Recycle**. This happens automatically as a result of applying retention periods or you may explicitly purge the volume using the :bcommand:`purge` command.
972
973   Once the volume is physically relabeled, the old data previously written on the Volume is lost and cannot be recovered.
974
975release
976   :index:`\ <single: Console; Command; release>`\  This command is used to cause the Storage daemon to release (and rewind) the current tape in the drive, and to re-read the Volume label the next time the tape is used.
977
978   .. code-block:: bconsole
979      :caption: release
980
981      release storage=<storage-name>
982
983   After a release command, the device is still kept open by Bareos (unless :config:option:`sd/device/AlwaysOpen = no`\ ) so it cannot be used by another program. However, with some tape drives, the operator can remove the current tape and to insert a different one, and when the next Job starts, Bareos will know to re-read the tape label to find out what tape is mounted. If you want to be able to use the drive with another program (e.g. :command:`mt`), you
984   must use the :bcommand:`unmount` command to cause Bareos to completely release (close) the device.
985
986reload
987   :index:`\ <single: Console; Command; reload>`\  The reload command causes the Director to re-read its configuration file and apply the new values. The new values will take effect immediately for all new jobs. However, if you change schedules, be aware that the scheduler pre-schedules jobs up to two hours in advance, so any changes that are to take place during the next two hours may be delayed. Jobs that have already been scheduled to run (i.e. surpassed their requested start time) will
988   continue with the old values. New jobs will use the new values. Each time you issue a reload command while jobs are running, the prior config values will queued until all jobs that were running before issuing the reload terminate, at which time the old config values will be released from memory. The Directory permits keeping up to ten prior set of configurations before it will refuse a reload command. Once at least one old set of config values has been released it will again accept new reload
989   commands.
990
991   While it is possible to reload the Director’s configuration on the fly, even while jobs are executing, this is a complex operation and not without side effects. Accordingly, if you have to reload the Director’s configuration while Bareos is running, it is advisable to restart the Director at the next convenient opportunity.
992
993rerun
994   :index:`\ <single: Console; Command; rerun>`\  The rerun command allows you to re-run a Job with exactly the same setting as the original Job. In Bareos, the job configuration is often altered by job overrides. These overrides alter the configuration of the job just for one job run. If because of any reason, a job with overrides fails, it is not easy to restart a new job that is exactly configured as the job that failed. The whole job configuration is automatically set to the defaults
995   and it is hard to configure everything like it was.
996
997   By using the rerun command, it is much easier to rerun a job exactly as it was configured. You only have to specify the JobId of the failed job.
998
999   .. code-block:: bconsole
1000      :caption: rerun
1001
1002      rerun jobid=<jobid> since_jobid=<jobid> days=<nr_days> hours=<nr_hours> yes
1003
1004   You can select the jobid(s) to rerun by using one of the selection criteria. Using jobid= will automatically select all jobs failed after and including the given jobid for rerunning. By using days= or hours=, you can select all failed jobids in the last number of days or number of hours respectively for rerunning.
1005
1006
1007.. _bcommandRestore:
1008
1009restore
1010   :index:`\ <single: Restore>`
1011   :index:`\ <single: Console; Command; restore>`
1012   :index:`\ <single: Console; File Selection>`
1013
1014   The restore command allows you to select one or more Jobs (JobIds) to be restored using various methods. Once the JobIds are selected, the File records for those Jobs are placed in an internal Bareos directory tree, and the restore enters a file selection mode that allows you to interactively walk up and down the
1015   file tree selecting individual files to be restored. This mode is somewhat similar to the standard Unix restore program’s interactive file selection mode.
1016
1017   .. code-block:: bconsole
1018      :caption: restore
1019
1020      restore storage=<storage-name> client=<backup-client-name>
1021        where=<path> pool=<pool-name> fileset=<fileset-name>
1022        restoreclient=<restore-client-name>
1023        restorejob=<job-name>
1024        select current all done
1025
1026   Where current, if specified, tells the restore command to automatically select a restore to the most current backup. If not specified, you will be prompted. The all specification tells the restore command to restore all files. If it is not specified, you will be prompted for the files to restore. For details of the restore command, please see the :ref:`Restore Chapter <RestoreChapter>` of this manual.
1027
1028   The client keyword initially specifies the client from which the backup was made and the client to which the restore will be make. However, if the restoreclient keyword is specified, then the restore is written to that client.
1029
1030   The restore job rarely needs to be specified, as bareos installations commonly only have a single restore job configured. However, for certain cases, such as a varying list of RunScript specifications, multiple restore jobs may be configured. The restorejob argument allows the selection of one of these jobs.
1031
1032   For more details, see the :ref:`Restore chapter <RestoreChapter>`.
1033
1034run
1035   :index:`\ <single: Console; Command; run>`
1036   This command allows you to schedule jobs to be run immediately.
1037
1038   The full form of the command is:
1039
1040   .. code-block:: bconsole
1041      :caption: run
1042
1043      run job=<job-name> client=<client-name> fileset=<fileset-name>
1044         level=<level> storage=<storage-name> where=<directory-prefix>
1045         when=<universal-time-specification> pool=<pool-name>
1046         pluginoptions=<plugin-options-string> accurate=<yes|no>
1047         comment=<text> spooldata=<yes|no> priority=<number>
1048         jobid=<jobid> catalog=<catalog> migrationjob=<job-name> backupclient=<client-name>
1049         backupformat=<format> nextpool=<pool-name> since=<universal-time-specification>
1050         verifyjob=<job-name> verifylist=<verify-list> migrationjob=<complete_name>
1051         yes
1052
1053   Any information that is needed but not specified will be listed for selection, and before starting the job, you will be prompted to accept, reject, or modify the parameters of the job to be run, unless you have specified yes, in which case the job will be immediately sent to the scheduler.
1054
1055   If you wish to start a job at a later time, you can do so by setting the When time. Use the mod option and select When (no. 6). Then enter the desired start time in YYYY-MM-DD HH:MM:SS format.
1056
1057   The spooldata argument of the run command cannot be modified through the menu and is only accessible by setting its value on the intial command line. If no spooldata flag is set, the job, storage or schedule flag is used.
1058
1059setbandwidth
1060   :index:`\ <single: Console; Command; setbandwidth>`\  This command (:sinceVersion:`12.4.1: setbandwidth`) is used to limit the bandwidth of a running job or a client.
1061
1062   .. code-block:: bconsole
1063      :caption: setbandwidth
1064
1065      setbandwidth limit=<nb> [jobid=<id> | client=<cli>]
1066
1067
1068.. _bcommandSetdebug:
1069
1070setdebug
1071   :index:`\ <single: Console; Command; setdebug>`
1072   :index:`\ <single: Debug; setdebug>`
1073   :index:`\ <single: Debug; Windows>`
1074   :index:`\ <single: Windows; Debug>`
1075
1076   This command is used to set the debug level in each daemon. The form of this command is:
1077
1078   .. code-block:: bconsole
1079      :caption: setdebug
1080
1081      setdebug level=nnn [trace=0/1 client=<client-name> | dir | director | storage=<storage-name> | all]
1082
1083   Each of the daemons normally has debug compiled into the program, but disabled. There are two ways to enable the debug output.
1084
1085   One is to add the -d nnn option on the command line when starting the daemon. The nnn is the debug level, and generally anything between 50 and 200 is reasonable. The higher the number, the more output is produced. The output is written to standard output.
1086
1087   The second way of getting debug output is to dynamically turn it on using the Console using the :command:`setdebug level=nnn` command. If none of the options are given, the command will prompt you. You can selectively turn on/off debugging in any or all the daemons (i.e. it is not necessary to specify all the components of the above command).
1088
1089   If trace=1 is set, then tracing will be enabled, and the daemon will be placed in trace mode, which means that all debug output as set by the debug level will be directed to his trace file in the current directory of the daemon. When tracing, each debug output message is appended to the trace file. You must explicitly delete the file when you are done.
1090
1091   .. code-block:: bconsole
1092      :caption: set Director debug level to 100 and get messages written to his trace file
1093
1094      *<input>setdebug level=100 trace=1 dir</input>
1095      level=100 trace=1 hangup=0 timestamp=0 tracefilename=/var/lib/bareos/bareos-dir.example.com.trace
1096
1097
1098.. _bcommandSetIP:
1099
1100setip
1101   :index:`\ <single: Console; Command; setip>`
1102
1103   Sets new client address – if authorized.
1104
1105   A console is authorized to use the SetIP command only if it has a Console resource definition in both the Director and the Console. In addition, if the console name, provided on the Name = directive, must be the same as a Client name, the user of that console is permitted to use the SetIP command to change the Address directive in the Director’s client resource to the IP address of the Console. This permits portables or other machines using DHCP (non-fixed IP addresses) to "notify" the
1106   Director of their current IP address.
1107
1108show
1109   :index:`\ <single: Console; Command; show>`
1110
1111   The show command will list the Director’s resource records as defined in the Director’s configuration.
1112   :bcommand:`help show` will show you all available options.The following keywords are accepted on the show command line:
1113
1114   .. code-block:: bconsole
1115
1116      *<input>help show</input>
1117        Command            Description
1118        =======            ===========
1119        show               Show resource records
1120
1121      Arguments:
1122              catalog=<catalog-name> |
1123              client=<client-name> |
1124              ...
1125              storages |
1126              disabled [ clients | jobs | schedules ] |
1127              all [verbose]
1128
1129   :bcommand:`show all` will show you all available resources.
1130   The **verbose** argument will show you also all configuration directives with there default value:
1131
1132   .. code-block:: bconsole
1133
1134      *<input>show client=bareos-fd verbose</input>
1135      Client {
1136        Name = "bareos-fd"
1137        Description = "Client resource of the Director itself."
1138        Address = "localhost"
1139        #  Port = 9102
1140        Password = "*************************************"
1141        #  Catalog = "MyCatalog"
1142        #  Passive = no
1143        #  ConnectionFromDirectorToClient = yes
1144        #  ConnectionFromClientToDirector = no
1145        #  Enabled = yes
1146        ...
1147      }
1148
1149   If you are not using the default console, but a named console,
1150   ACLs are applied.
1151   Additionally, if the named console don't have the permission
1152   to run the :bcommand:`configure` command,
1153   some resources (like consoles and profiles) are not shown at all.
1154
1155   Please don’t confuse this command with the :bcommand:`list` command, which displays the contents of the catalog.
1156
1157
1158sqlquery
1159   :index:`\ <single: Console; Command; sqlquery>`\  The sqlquery command puts the Console program into SQL query mode where each line you enter is concatenated to the previous line until a semicolon (;) is seen. The semicolon terminates the command, which is then passed directly to the SQL database engine. When the output from the SQL engine is displayed, the formation of a new SQL command begins. To terminate SQL query mode and return to the Console command prompt, you enter a period (.)
1160   in column 1.
1161
1162   Using this command, you can query the SQL catalog database directly. Note you should really know what you are doing otherwise you could damage the catalog database. See the query command below for simpler and safer way of entering SQL queries.
1163
1164   Depending on what database engine you are using (MySQL, PostgreSQL or SQLite), you will have somewhat different SQL commands available. For more detailed information, please refer to the MySQL, PostgreSQL or SQLite documentation.
1165
1166status
1167   :index:`\ <single: Console; Command; status>`\
1168
1169   This command will display the status of all components. For the director, it will display the next jobs that are scheduled during the next 24 hours as well as the status of currently running jobs. For the Storage Daemon, you will have drive status or autochanger content. The File Daemon will give you information about current jobs like average speed or file accounting. The full form of this command is:
1170
1171   .. code-block:: bconsole
1172      :caption: status
1173
1174      status [all | dir=<dir-name> | director | scheduler | schedule=<schedule-name> |
1175              client=<client-name> | storage=<storage-name> slots | subscriptions]
1176
1177   If you do a status dir, the console will list any currently running jobs, a summary of all jobs scheduled to be run in the next 24 hours, and a listing of the last ten terminated jobs with their statuses. The scheduled jobs summary will include the Volume name to be used. You should be aware of two things: 1. to obtain the volume name, the code goes through the same code that will be used when the job runs, but it does not do pruning nor recycling of Volumes; 2. The Volume listed is at best a
1178   guess. The Volume actually used may be different because of the time difference (more durations may expire when the job runs) and another job could completely fill the Volume requiring a new one.
1179
1180   In the Running Jobs listing, you may find the following types of information:
1181
1182   .. code-block:: bconsole
1183
1184      2507 Catalog MatouVerify.2004-03-13_05.05.02 is waiting execution
1185      5349 Full    CatalogBackup.2004-03-13_01.10.00 is waiting for higher
1186                   priority jobs to finish
1187      5348 Differe Minou.2004-03-13_01.05.09 is waiting on max Storage jobs
1188      5343 Full    Rufus.2004-03-13_01.05.04 is running
1189
1190   Looking at the above listing from bottom to top, obviously JobId 5343 (Rufus) is running. JobId 5348 (Minou) is waiting for JobId 5343 to finish because it is using the Storage resource, hence the "waiting on max Storage jobs". JobId 5349 has a lower priority than all the other jobs so it is waiting for higher priority jobs to finish, and finally, JobId 2507 (MatouVerify) is waiting because only one job can run at a time, hence it is simply "waiting execution"
1191
1192   If you do a status dir, it will by default list the first occurrence of all jobs that are scheduled today and tomorrow. If you wish to see the jobs that are scheduled in the next three days (e.g. on Friday you want to see the first occurrence of what tapes are scheduled to be used on Friday, the weekend, and Monday), you can add the days=3 option. Note, a days=0 shows the first occurrence of jobs scheduled today only. If you have multiple run statements, the first occurrence of each run
1193   statement for the job will be displayed for the period specified.
1194
1195   If your job seems to be blocked, you can get a general idea of the problem by doing a status dir, but you can most often get a much more specific indication of the problem by doing a status storage=xxx. For example, on an idle test system, when I do status storage=File, I get:
1196
1197   .. code-block:: bconsole
1198      :caption: status storage
1199
1200      *<input>status storage=File</input>
1201      Connecting to Storage daemon File at 192.168.68.112:8103
1202
1203      rufus-sd Version: 1.39.6 (24 March 2006) i686-pc-linux-gnu redhat (Stentz)
1204      Daemon started 26-Mar-06 11:06, 0 Jobs run since started.
1205
1206      Running Jobs:
1207      No Jobs running.
1208      ====
1209
1210      Jobs waiting to reserve a drive:
1211      ====
1212
1213      Terminated Jobs:
1214       JobId  Level   Files          Bytes Status   Finished        Name
1215      ======================================================================
1216          59  Full        234      4,417,599 OK       15-Jan-06 11:54 usersave
1217      ====
1218
1219      Device status:
1220      Autochanger "DDS-4-changer" with devices:
1221         "DDS-4" (/dev/nst0)
1222      Device "DDS-4" (/dev/nst0) is mounted with Volume="TestVolume002"
1223      Pool="*unknown*"
1224          Slot 2 is loaded in drive 0.
1225          Total Bytes Read=0 Blocks Read=0 Bytes/block=0
1226          Positioned at File=0 Block=0
1227
1228      Device "File" (/tmp) is not open.
1229      ====
1230
1231      In Use Volume status:
1232      ====
1233
1234   Now, what this tells me is that no jobs are running and that none of the devices are in use. Now, if I unmount the autochanger, which will not be used in this example, and then start a Job that uses the File device, the job will block. When I re-issue the status storage command, I get for the Device status:
1235
1236   .. code-block:: bconsole
1237      :caption: status storage
1238
1239      *<input>status storage=File</input>
1240      ...
1241      Device status:
1242      Autochanger "DDS-4-changer" with devices:
1243         "DDS-4" (/dev/nst0)
1244      Device "DDS-4" (/dev/nst0) is not open.
1245          Device is BLOCKED. User unmounted.
1246          Drive 0 is not loaded.
1247
1248      Device "File" (/tmp) is not open.
1249          Device is BLOCKED waiting for media.
1250      ====
1251      ...
1252
1253   Now, here it should be clear that if a job were running that wanted to use the Autochanger (with two devices), it would block because the user unmounted the device. The real problem for the Job I started using the "File" device is that the device is blocked waiting for media – that is Bareos needs you to label a Volume.
1254
1255   The command :bcommand:`status scheduler` (:sinceVersion:`12.4.4: status scheduler`) can be used to check when a certain schedule will trigger. This gives more information than :bcommand:`status director`.
1256
1257   Called without parameters, :bcommand:`status scheduler` shows a preview for all schedules for the next 14 days. It first shows a list of the known schedules and the jobs that will be triggered by these jobs, and next, a table with date (including weekday), schedule name and applied overrides is displayed:
1258
1259   .. code-block:: bconsole
1260      :caption: status scheduler
1261
1262      *<input>status scheduler</input>
1263      Scheduler Jobs:
1264
1265      Schedule               Jobs Triggered
1266      ===========================================================
1267      WeeklyCycle
1268                             BackupClient1
1269
1270      WeeklyCycleAfterBackup
1271                             BackupCatalog
1272
1273      ====
1274
1275      Scheduler Preview for 14 days:
1276
1277      Date                  Schedule                Overrides
1278      ==============================================================
1279      Di 04-Jun-2013 21:00  WeeklyCycle             Level=Incremental
1280      Di 04-Jun-2013 21:10  WeeklyCycleAfterBackup  Level=Full
1281      Mi 05-Jun-2013 21:00  WeeklyCycle             Level=Incremental
1282      Mi 05-Jun-2013 21:10  WeeklyCycleAfterBackup  Level=Full
1283      Do 06-Jun-2013 21:00  WeeklyCycle             Level=Incremental
1284      Do 06-Jun-2013 21:10  WeeklyCycleAfterBackup  Level=Full
1285      Fr 07-Jun-2013 21:00  WeeklyCycle             Level=Incremental
1286      Fr 07-Jun-2013 21:10  WeeklyCycleAfterBackup  Level=Full
1287      Sa 08-Jun-2013 21:00  WeeklyCycle             Level=Differential
1288      Mo 10-Jun-2013 21:00  WeeklyCycle             Level=Incremental
1289      Mo 10-Jun-2013 21:10  WeeklyCycleAfterBackup  Level=Full
1290      Di 11-Jun-2013 21:00  WeeklyCycle             Level=Incremental
1291      Di 11-Jun-2013 21:10  WeeklyCycleAfterBackup  Level=Full
1292      Mi 12-Jun-2013 21:00  WeeklyCycle             Level=Incremental
1293      Mi 12-Jun-2013 21:10  WeeklyCycleAfterBackup  Level=Full
1294      Do 13-Jun-2013 21:00  WeeklyCycle             Level=Incremental
1295      Do 13-Jun-2013 21:10  WeeklyCycleAfterBackup  Level=Full
1296      Fr 14-Jun-2013 21:00  WeeklyCycle             Level=Incremental
1297      Fr 14-Jun-2013 21:10  WeeklyCycleAfterBackup  Level=Full
1298      Sa 15-Jun-2013 21:00  WeeklyCycle             Level=Differential
1299      Mo 17-Jun-2013 21:00  WeeklyCycle             Level=Incremental
1300      Mo 17-Jun-2013 21:10  WeeklyCycleAfterBackup  Level=Full
1301      ====
1302
1303   :bcommand:`status scheduler` accepts the following parameters:
1304
1305   client=clientname
1306      shows only the schedules that affect the given client.
1307
1308   job=jobname
1309      shows only the schedules that affect the given job.
1310
1311   schedule=schedulename
1312      shows only the given schedule.
1313
1314   days=number
1315      of days shows only the number of days in the scheduler preview. Positive numbers show the future, negative numbers show the past. days can be combined with the other selection criteria. days= can be combined with the other selection criteria.
1316
1317   In case you are running a maintained version of Bareos, the command :bcommand:`status subscriptions` (:sinceVersion:`12.4.4: status subscriptions`) can help you to keep the overview over the subscriptions that are used.
1318
1319   To enable this functionality, just add the configuration :config:option:`dir/director/Subscriptions`\  directive and specify the number of subscribed clients, for example:
1320
1321   .. code-block:: bareosconfig
1322      :caption: enable subscription check
1323
1324      Director {
1325         ...
1326         Subscriptions = 50
1327      }
1328
1329   Using the console command :bcommand:`status subscriptions`, the status of the subscriptions can be checked any time interactively:
1330
1331   .. code-block:: bconsole
1332      :caption: status subscriptions
1333
1334      *<input>status subscriptions</input>
1335      Ok: available subscriptions: 8 (42/50) (used/total)
1336
1337   Also, the number of subscriptions is checked after every job. If the number of clients is bigger than the configured limit, a Job warning is created a message like this:
1338
1339   .. code-block:: bconsole
1340      :caption: subscriptions warning
1341
1342      JobId 7: Warning: Subscriptions exceeded: (used/total) (51/50)
1343
1344   Please note: Nothing else than the warning is issued, no enforcement on backup, restore or any other operation will happen.
1345
1346   Setting the value for :config:option:`dir/director/Subscriptions = 0`\  disables this functionality:
1347
1348   .. code-block:: bareosconfig
1349      :caption: disable subscription check
1350
1351      Director {
1352         ...
1353         Subscriptions = 0
1354      }
1355
1356   Not configuring the directive at all also disables it, as the default value for the Subscriptions directive is zero.
1357
1358time
1359   :index:`\ <single: Console; Command; time>`\  The time command shows the current date, time and weekday.
1360
1361trace
1362   :index:`\ <single: Console; Command; trace>`\  Turn on/off trace to file.
1363
1364truncate
1365   :index:`\ <single: Console; Command; truncate>`\  :index:`\ <single: Disk; Freeing disk space>`\  :index:`\ <single: Disk; Freeing disk space>`\
1366
1367.. _bcommandTruncate:
1368
1369
1370
1371   If the status of a volume is **Purged**, it normally still contains data, even so it can not easily be accessed.
1372
1373   .. code-block:: bconsole
1374      :caption: truncate
1375
1376      truncate volstatus=Purged [storage=<storage>] [pool=<pool>] [volume=<volume>] [yes]
1377
1378   When using a disk volume (and other volume types also) the volume file still resides on the |sd|. If you want to reclaim disk space, you can use the :bcommand:`truncate volstatus=Purged` command. When used on a volume, it rewrites the header and by this frees the rest of the disk space.
1379
1380   If the volume you want to get rid of has not the **Purged** status, you first have to use the :bcommand:`prune volume` or even the :bcommand:`purge volume` command to free the volume from all remaining jobs.
1381
1382   This command is available since Bareos :sinceVersion:`16.2.5: truncate command`.
1383
1384umount
1385   :index:`\ <single: Console; Command; umount>`\  Alias for :bcommand:`unmount`.
1386
1387unmount
1388   :index:`\ <single: Console; Command; unmount>`\  This command causes the indicated Bareos Storage daemon to unmount the specified device. The forms of the command are the same as the mount command:
1389
1390   .. code-block:: bconsole
1391      :caption: unmount
1392
1393      unmount storage=<storage-name> [drive=<num>]
1394      unmount [jobid=<id> | job=<job-name>]
1395
1396   Once you unmount a storage device, Bareos will no longer be able to use it until you issue a mount command for that device. If Bareos needs to access that device, it will block and issue mount requests periodically to the operator.
1397
1398   If the device you are unmounting is an autochanger, it will unload the drive you have specified on the command line. If no drive is specified, it will assume drive 1.
1399
1400   In most cases, it is preferable to use the :bcommand:`release` instead.
1401
1402
1403.. _UpdateCommand:
1404
1405update
1406   :index:`\ <single: Console; Command; update>`
1407
1408   This command will update the catalog for either a specific Pool record, a Volume record, or the Slots in an autochanger with barcode capability. In the case of updating a Pool record, the new information will be automatically taken from the corresponding Director’s configuration resource record. It can be used to increase the maximum number of volumes permitted or to set a maximum number of volumes. The
1409   following main keywords may be specified:
1410
1411   -  volume
1412
1413   -  pool
1414
1415   -  slots
1416
1417   -  iobid
1418
1419   -  stats
1420
1421   In the case of updating a Volume (:bcommand:`update volume`), you will be prompted for which value you wish to change. The following Volume parameters may be changed:
1422
1423   ::
1424
1425         Volume Status
1426         Volume Retention Period
1427         Volume Use Duration
1428         Maximum Volume Jobs
1429         Maximum Volume Files
1430         Maximum Volume Bytes
1431         Recycle Flag
1432         Recycle Pool
1433         Slot
1434         InChanger Flag
1435         Pool
1436         Volume Files
1437         Volume from Pool
1438         All Volumes from Pool
1439         All Volumes from all Pools
1440
1441
1442
1443   For slots :bcommand:`update slots`, Bareos will obtain a list of slots and their barcodes from the Storage daemon, and for each barcode found, it will automatically update the slot in the catalog Media record to correspond to the new value. This is very useful if you have moved cassettes in the magazine, or if you have removed the magazine and inserted a different one. As the slot of each Volume is updated, the InChanger flag for that Volume will also be set, and any other
1444   Volumes in the Pool that were last mounted on the same Storage device will have their InChanger flag turned off. This permits Bareos to know what magazine (tape holder) is currently in the autochanger.
1445
1446   If you do not have barcodes, you can accomplish the same thing by using the :bcommand:`update slots scan` command. The :strong:`scan` keyword tells Bareos to physically mount each tape and to read its VolumeName.
1447
1448   For Pool :bcommand:`update pool`, Bareos will move the Volume record from its existing pool to the pool specified.
1449
1450   For Volume from Pool, All Volumes from Pool and All Volumes from all Pools, the following values are updated from the Pool record: Recycle, RecyclePool, VolRetention, VolUseDuration, MaxVolJobs, MaxVolFiles, and MaxVolBytes.
1451
1452   For updating the statistics, use :bcommand:`updates stats`, see :ref:`section-JobStatistics`.
1453
1454   The full form of the update command with all command line arguments is:
1455
1456   .. code-block:: bconsole
1457      :caption: update
1458
1459      update  volume=<volume-name> [volstatus=<status>]
1460              [volretention=<time-def>] [pool=<pool-name>]
1461              [recycle=<yes/no>] [slot=<number>] [inchanger=<yes/no>] |
1462              pool=<pool-name> [maxvolbytes=<size>] [maxvolfiles=<nb>]
1463              [maxvoljobs=<nb>][enabled=<yes/no>] [recyclepool=<pool-name>]
1464              [actiononpurge=<action>] |
1465              slots [storage=<storage-name>] [scan] |
1466              jobid=<jobid> [jobname=<name>] [starttime=<time-def>]
1467              [client=<client-name>] [filesetid=<fileset-id>]
1468              [jobtype=<job-type>] |
1469              stats [days=<number>]
1470
1471use
1472   :index:`\ <single: Console; Command; use>`
1473   This command allows you to specify which Catalog database to use. Normally, you will be using only one database so this will be done automatically. In the case that you are using more than one database, you can use this command to switch from one to another.
1474
1475   .. code-block:: bconsole
1476      :caption: use
1477
1478      use [catalog=<catalog>]
1479
1480.. _var:
1481
1482var
1483   :index:`\ <single: Console; Command; var>`
1484   This command takes a string or quoted string and does variable expansion on it mostly the same way variable expansion is done on the :config:option:`dir/pool/LabelFormat`\  string. The difference between the :bcommand:`var` command and the actual :config:option:`dir/pool/LabelFormat`\  process is that during the var command, no job is running so dummy values are
1485   used in place of Job specific variables.
1486
1487version
1488   :index:`\ <single: Console; Command; version>`
1489   The command prints the Director’s version.
1490
1491wait
1492   :index:`\ <single: Console; Command; wait>`\  The wait command causes the Director to pause until there are no jobs running. This command is useful in a batch situation such as regression testing where you wish to start a job and wait until that job completes before continuing. This command now has the following options:
1493
1494   .. code-block:: bconsole
1495      :caption: wait
1496
1497      wait [jobid=<jobid>] [jobuid=<unique id>] [job=<job name>]
1498
1499   If specified with a specific JobId, ... the wait command will wait for that particular job to terminate before continuing.
1500
1501whoami
1502   :index:`\ <single: Console; Command; whoami>`
1503   Print the name of the user associated with this console.
1504
1505
1506.. _dotcommands:
1507
1508Special dot (.) Commands
1509~~~~~~~~~~~~~~~~~~~~~~~~
1510
1511:index:`\ <single: Console; Command; . commands>`\
1512
1513There is a list of commands that are prefixed with a period (.). These commands are intended to be used either by batch programs or graphical user interface front-ends. They are not normally used by interactive users. For details, see `Bareos Developer Guide (dot-commands) <../DeveloperGuide/api.html#dot-commands>`_.
1514
1515.. _atcommands:
1516
1517Special At (@) Commands
1518~~~~~~~~~~~~~~~~~~~~~~~
1519
1520Normally, all commands entered to the Console program are immediately forwarded to the Director, which may be on another machine, to be executed. However, there is a small list of at commands, all beginning with an at character (@), that will not be sent to the Director, but rather interpreted by the Console program directly. Note, these commands are implemented only in the TTY console program and not in the Bat Console. These commands are:
1521
1522@input <filename>
1523   :index:`\ <single: Console; Command; @input <filename>>`\  Read and execute the commands contained in the file specified.
1524
1525@output <filename> <w|a>
1526   :index:`\ <single: Console; Command; @output <filename> <w|a>>`\  Send all following output to the filename specified either overwriting the file (w) or appending to the file (a). To redirect the output to the terminal, simply enter @output without a filename specification. WARNING: be careful not to overwrite a valid file. A typical example during a regression test might be:
1527
1528
1529
1530   ::
1531
1532          @output /dev/null
1533          commands ...
1534          @output
1535
1536
1537
1538@tee <filename> <w|a>
1539   :index:`\ <single: Console; Command; @tee <filename> <w|a>>`\  Send all subsequent output to both the specified file and the terminal. It is turned off by specifying @tee or @output without a filename.
1540
1541@sleep <seconds>
1542   :index:`\ <single: Console; Command; @sleep <seconds>>`\  Sleep the specified number of seconds.
1543
1544@time
1545   :index:`\ <single: Console; Command; @time>`\  Print the current time and date.
1546
1547@version
1548   :index:`\ <single: Console; Command; @version>`\  Print the console’s version.
1549
1550@quit
1551   :index:`\ <single: Console; Command; @quit>`\  quit
1552
1553@exit
1554   :index:`\ <single: Console; Command; @exit>`\  quit
1555
1556@# anything
1557   :index:`\ <single: Console; Command; @# anything>`\  Comment
1558
1559@help
1560   :index:`\ <single: Console; Command; @help>`\  Get the list of every special @ commands.
1561
1562@separator <char>
1563   :index:`\ <single: Console; Command; @separator>`\  When using bconsole with readline, you can set the command separator to one of those characters to write commands who require multiple input on one line, or to put multiple commands on a single line.
1564
1565   ::
1566
1567        !$%&'()*+,-/:;<>?[]^`{|}~
1568
1569   Note, if you use a semicolon (;) as a separator character, which is common, you will not be able to use the sql command, which requires each command to be terminated by a semicolon.
1570
1571Adding Volumes to a Pool
1572------------------------
1573
1574:index:`\ <single: Console; Adding a Volume to a Pool>`\
1575
1576.. TODO: move to another chapter
1577
1578If you have used the label command to label a Volume, it will be automatically added to the Pool, and you will not need to add any media to the pool.
1579
1580Alternatively, you may choose to add a number of Volumes to the pool without labeling them. At a later time when the Volume is requested by Bareos you will need to label it.
1581
1582Before adding a volume, you must know the following information:
1583
1584#. The name of the Pool (normally "Default")
1585
1586#. The Media Type as specified in the Storage Resource in the Director’s configuration file (e.g. "DLT8000")
1587
1588#. The number and names of the Volumes you wish to create.
1589
1590For example, to add media to a Pool, you would issue the following commands to the console program:
1591
1592
1593
1594::
1595
1596   *add
1597   Enter name of Pool to add Volumes to: Default
1598   Enter the Media Type: DLT8000
1599   Enter number of Media volumes to create. Max=1000: 10
1600   Enter base volume name: Save
1601   Enter the starting number: 1
1602   10 Volumes created in pool Default
1603   *
1604
1605
1606
1607To see what you have added, enter:
1608
1609
1610
1611::
1612
1613   *list media pool=Default
1614   +-------+----------+---------+---------+-------+------------------+
1615   | MedId | VolumeNa | MediaTyp| VolStat | Bytes | LastWritten      |
1616   +-------+----------+---------+---------+-------+------------------+
1617   |    11 | Save0001 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
1618   |    12 | Save0002 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
1619   |    13 | Save0003 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
1620   |    14 | Save0004 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
1621   |    15 | Save0005 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
1622   |    16 | Save0006 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
1623   |    17 | Save0007 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
1624   |    18 | Save0008 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
1625   |    19 | Save0009 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
1626   |    20 | Save0010 | DLT8000 | Append  |     0 | 0000-00-00 00:00 |
1627   +-------+----------+---------+---------+-------+------------------+
1628   *
1629
1630
1631
1632Notice that the console program automatically appended a number to the base Volume name that you specify (Save in this case). If you don’t want it to append a number, you can simply answer 0 (zero) to the question "Enter number of Media volumes to create. Max=1000:", and in this case, it will create a single Volume with the exact name you specify.
1633
1634
1635