From bdc591aa468dec321a77ce7b7ccdc2d6b4e684f1 Mon Sep 17 00:00:00 2001 From: Frank Ueberschar Date: Tue, 5 Mar 2019 12:53:25 +0100 Subject: [PATCH] docs: prepared chapter for Multiply Device feature --- core/src/stored/stored_conf.cc | 18 +++---- .../source/index-developer-guide.rst | 1 + .../source/multiplied_device.rst | 51 +++++++++++++++++++ 3 files changed, 61 insertions(+), 9 deletions(-) create mode 100644 docs/manuals/en/new_main_reference/source/multiplied_device.rst diff --git a/core/src/stored/stored_conf.cc b/core/src/stored/stored_conf.cc index dd540161ab7..182da104412 100644 --- a/core/src/stored/stored_conf.cc +++ b/core/src/stored/stored_conf.cc @@ -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}}; /** @@ -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 @@ -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_; } @@ -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); } @@ -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); @@ -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); } @@ -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; diff --git a/docs/manuals/en/new_main_reference/source/index-developer-guide.rst b/docs/manuals/en/new_main_reference/source/index-developer-guide.rst index 456f0285349..8f14f59c022 100644 --- a/docs/manuals/en/new_main_reference/source/index-developer-guide.rst +++ b/docs/manuals/en/new_main_reference/source/index-developer-guide.rst @@ -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 diff --git a/docs/manuals/en/new_main_reference/source/multiplied_device.rst b/docs/manuals/en/new_main_reference/source/multiplied_device.rst new file mode 100644 index 00000000000..3dbe8b621eb --- /dev/null +++ b/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. +