register-fs-repo.asciidoc 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. // tag::unix[]
  2. Linux and macOS installations support Unix-style paths:
  3. [source,yaml]
  4. ----
  5. path:
  6. repo:
  7. - /mount/backups
  8. - /mount/long_term_backups
  9. ----
  10. // tag::register-fs-repo[]
  11. After restarting each node, use {kib} or the <<put-snapshot-repo-api,create
  12. snapshot repository API>> to register the repository. When registering the
  13. repository, specify the file system's path:
  14. // end::register-fs-repo[]
  15. [source,console]
  16. ----
  17. PUT _snapshot/my_fs_backup
  18. {
  19. "type": "fs",
  20. "settings": {
  21. "location": "/mount/backups/my_fs_backup_location"
  22. }
  23. }
  24. ----
  25. // TEST[skip:no access to path]
  26. // tag::relative-path[]
  27. If you specify a relative path, {es} resolves the path using the first value in
  28. the `path.repo` setting.
  29. // end::relative-path[]
  30. [source,console]
  31. ----
  32. PUT _snapshot/my_fs_backup
  33. {
  34. "type": "fs",
  35. "settings": {
  36. "location": "my_fs_backup_location" <1>
  37. }
  38. }
  39. ----
  40. // TEST[skip:no access to path]
  41. <1> The first value in the `path.repo` setting is `/mount/backups`. This
  42. relative path, `my_fs_backup_location`, resolves to
  43. `/mount/backups/my_fs_backup_location`.
  44. include::{es-repo-dir}/snapshot-restore/register-repository.asciidoc[tag=multi-cluster-repo]
  45. // tag::fs-repo-read-only[]
  46. To register a file system repository as read-only using the create snapshot
  47. repository API, set the `readonly` parameter to true. Alternatively, you can
  48. register a <<snapshots-read-only-repository,URL repository>> for the file
  49. system.
  50. // end::fs-repo-read-only[]
  51. [source,console]
  52. ----
  53. PUT _snapshot/my_fs_backup
  54. {
  55. "type": "fs",
  56. "settings": {
  57. "location": "my_fs_backup_location",
  58. "readonly": true
  59. }
  60. }
  61. ----
  62. // end::unix[]
  63. // tag::win[]
  64. Windows installations support both DOS and Microsoft UNC paths. Escape any
  65. backslashes in the paths. For UNC paths, provide the server and share name as a
  66. prefix.
  67. [source,yaml]
  68. ----
  69. path:
  70. repo:
  71. - "E:\\Mount\\Backups" <1>
  72. - "\\\\MY_SERVER\\Mount\\Long_term_backups" <2>
  73. ----
  74. <1> DOS path
  75. <2> UNC path
  76. include::register-fs-repo.asciidoc[tag=register-fs-repo]
  77. [source,console]
  78. ----
  79. PUT _snapshot/my_fs_backup
  80. {
  81. "type": "fs",
  82. "settings": {
  83. "location": "E:\\Mount\\Backups\\My_fs_backup_location"
  84. }
  85. }
  86. ----
  87. // TEST[skip:no access to path]
  88. include::register-fs-repo.asciidoc[tag=relative-path]
  89. [source,console]
  90. ----
  91. PUT _snapshot/my_fs_backup
  92. {
  93. "type": "fs",
  94. "settings": {
  95. "location": "My_fs_backup_location" <1>
  96. }
  97. }
  98. ----
  99. // TEST[skip:no access to path]
  100. <1> The first value in the `path.repo` setting is `E:\Mount\Backups`. This
  101. relative path, `My_fs_backup_location`, resolves to
  102. `E:\Mount\Backups\My_fs_backup_location`.
  103. include::{es-repo-dir}/snapshot-restore/register-repository.asciidoc[tag=multi-cluster-repo]
  104. include::register-fs-repo.asciidoc[tag=fs-repo-read-only]
  105. [source,console]
  106. ----
  107. PUT _snapshot/my_fs_backup
  108. {
  109. "type": "fs",
  110. "settings": {
  111. "location": "my_fs_backup_location",
  112. "readonly": true
  113. }
  114. }
  115. ----
  116. // TEST[skip:no access to path]
  117. // end::win[]