Skip to content

Commit

Permalink
docs: prepared chapter for Multiply Device feature
Browse files Browse the repository at this point in the history
  • Loading branch information
franku committed Apr 2, 2019
1 parent 10d495d commit bdc591a
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 9 deletions.
18 changes: 9 additions & 9 deletions core/src/stored/stored_conf.cc
Expand Up @@ -225,7 +225,7 @@ static ResourceItem dev_items[] = {
"this option if your tape-drive fails to detect end-of-tape while reading."},
{"Count", CFG_TYPE_PINT32, ITEM(res_dev.count), 0, CFG_ITEM_DEFAULT, "1", NULL, "If Count is set to (1 < Count < 10000), "
"this resource will be multiplied Count times. The names of multiplied resources will have a serial number (0001, 0002, ...) attached. "
"If set to 1 only this single resource will be used and then its name will not be altered."},
"If set to 1 only this single resource will be used and its name will not be altered."},
{NULL, 0, {0}, 0, 0, NULL, NULL, NULL}};

/**
Expand Down Expand Up @@ -269,9 +269,9 @@ static ResourceTable resources[] = {
* Authentication methods
*/
static struct s_kw authmethods[] = {{"None", AT_NONE},
{"Clear", AT_CLEAR},
{"MD5", AT_MD5},
{NULL, 0}};
{"Clear", AT_CLEAR},
{"MD5", AT_MD5},
{NULL, 0}};

/**
* Device types
Expand Down Expand Up @@ -937,7 +937,7 @@ static void FreeResource(CommonResourceHeader* sres, int type)
if (res->res_dir.tls_cert_.allowed_certificate_common_names_) {
res->res_dir.tls_cert_.allowed_certificate_common_names_->destroy();
free(res->res_dir.tls_cert_.allowed_certificate_common_names_);
}
}
if (res->res_dir.tls_cert_.ca_certfile_) {
delete res->res_dir.tls_cert_.ca_certfile_;
}
Expand Down Expand Up @@ -968,7 +968,7 @@ static void FreeResource(CommonResourceHeader* sres, int type)
case R_AUTOCHANGER:
if (res->res_changer.changer_name) {
free(res->res_changer.changer_name);
}
}
if (res->res_changer.changer_command) {
free(res->res_changer.changer_command);
}
Expand All @@ -979,7 +979,7 @@ static void FreeResource(CommonResourceHeader* sres, int type)
if (res->res_store.SDaddrs) { FreeAddresses(res->res_store.SDaddrs); }
if (res->res_store.SDsrc_addr) {
FreeAddresses(res->res_store.SDsrc_addr);
}
}
if (res->res_store.NDMPaddrs) { FreeAddresses(res->res_store.NDMPaddrs); }
if (res->res_store.working_directory) {
free(res->res_store.working_directory);
Expand Down Expand Up @@ -1039,7 +1039,7 @@ static void FreeResource(CommonResourceHeader* sres, int type)
if (res->res_dev.device_options) { free(res->res_dev.device_options); }
if (res->res_dev.diag_device_name) {
free(res->res_dev.diag_device_name);
}
}
if (res->res_dev.changer_name) { free(res->res_dev.changer_name); }
if (res->res_dev.changer_command) { free(res->res_dev.changer_command); }
if (res->res_dev.alert_command) { free(res->res_dev.alert_command); }
Expand All @@ -1059,7 +1059,7 @@ static void FreeResource(CommonResourceHeader* sres, int type)
if (res->res_msgs.operator_cmd) { free(res->res_msgs.operator_cmd); }
if (res->res_msgs.timestamp_format) {
free(res->res_msgs.timestamp_format);
}
}
FreeMsgsRes((MessagesResource*)res); /* free message resource */
res = NULL;
break;
Expand Down
Expand Up @@ -10,6 +10,7 @@ Bareos Developer Guide
developers/daemonprotocol.rst
developers/file.rst
developers/storage.rst
multiplied_device.rst
developers/catalog.rst
developers/mediaformat.rst
developers/porting.rst
Expand Down
51 changes: 51 additions & 0 deletions docs/manuals/en/new_main_reference/source/multiplied_device.rst
@@ -0,0 +1,51 @@
.. This chapter is in preparation to be a subchapter of the _StorageResourceDevice chapter.
.. _StorageResourceMultipliedDevice:

Multiplied Device
~~~~~~~~~~~~~~~~~

The Multiplied Device feature can be used when multiple identical devices are needed.
In this case the :config:option:`sd/device/Count` can be added to the regarding Device resource.

When the configuration is loaded the |bareosSD| will then automatically multiply this device :config:option:`sd/device/Count` times. The number of multiplied devices includes the original Device.

A number "0001" will be appended to name of the initial Device. All other multiplied Devices have increasing numbers "0002", "0003", accordingly. In the example below the name of the multiplied devices will be "MultiFileStorage0001", "MultiFileStorage0002", and so on.

.. code-block:: bareosconfig
:caption: bareos-sd.d/device/multiplied_device.conf
Device {
#Multiply this device Count times
Count = 3
Name = MultiFileStorage
Media Type = File
Archive Device = /home/testuser/multiplied-device-test/storage
LabelMedia = yes # lets Bareos label unlabeled media
Random Access = yes
AutomaticMount = yes # when device opened, read it
RemovableMedia = no
AlwaysOpen = no
Description = "File device. Will be multiplied 3 times"
}
In the |bareosDir| any of the Multiplied Devices can be referred to using their numbered names.

However, in the autochanger resource of the |bareosSD| the original name of the initial Multiplied Device Resource can be used.

.. code-block:: bareosconfig
:caption: bareos-sd.d/autochanger/autochanger.conf
Autochanger {
Name = "virtual-autochanger"
# list here only the name of the initial multiplied device resource
Device = MultiFileStorage
Changer Device = /dev/null
Changer Command = ""
}
When the configuration is exported, again only the name of the initial Multiplied Device Resource will be printed.

0 comments on commit bdc591a

Please sign in to comment.