register-fs-repo.asciidoc 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. After restarting each node, use the <<put-snapshot-repo-api,create or update
  11. snapshot repository>> API to register the file system repository. Specify the
  12. file system's path in `settings.location`:
  13. [source,console]
  14. ----
  15. PUT /_snapshot/my_fs_backup
  16. {
  17. "type": "fs",
  18. "settings": {
  19. "location": "/mount/backups/my_fs_backup_location",
  20. "compress": true
  21. }
  22. }
  23. ----
  24. // TEST[skip:no access to path]
  25. If you specify a relative path in `settings.location`, {es} resolves the path
  26. using the first value in the `path.repo` setting.
  27. [source,console]
  28. ----
  29. PUT /_snapshot/my_fs_backup
  30. {
  31. "type": "fs",
  32. "settings": {
  33. "location": "my_fs_backup_location", <1>
  34. "compress": true
  35. }
  36. }
  37. ----
  38. // TEST[skip:no access to path]
  39. <1> The first value in the `path.repo` setting is `/mount/backups`. This
  40. relative path, `my_fs_backup_location`, resolves to
  41. `/mount/backups/my_fs_backup_location`.
  42. // end::unix[]
  43. // tag::win[]
  44. Windows installations support both DOS and Microsoft UNC paths. Escaped any
  45. backslashes in the paths. For UNC paths, provide the server and share name as a
  46. prefix.
  47. [source,yaml]
  48. ----
  49. path:
  50. repo:
  51. - "E:\\Mount\\Backups" <1>
  52. - "\\\\MY_SERVER\\Mount\\Long_term_backups" <2>
  53. ----
  54. <1> DOS path
  55. <2> UNC path
  56. After restarting each node, use the <<put-snapshot-repo-api,create or update
  57. snapshot repository>> API to register the file system repository. Specify the
  58. file system's path in `settings.location`:
  59. [source,console]
  60. ----
  61. PUT /_snapshot/my_fs_backup
  62. {
  63. "type": "fs",
  64. "settings": {
  65. "location": "E:\\Mount\\Backups\\My_fs_backup_location",
  66. "compress": true
  67. }
  68. }
  69. ----
  70. // TEST[skip:no access to path]
  71. If you specify a relative path in `settings.location`, {es} resolves the path
  72. using the first value in the `path.repo` setting.
  73. [source,console]
  74. ----
  75. PUT /_snapshot/my_fs_backup
  76. {
  77. "type": "fs",
  78. "settings": {
  79. "location": "My_fs_backup_location", <1>
  80. "compress": true
  81. }
  82. }
  83. ----
  84. // TEST[skip:no access to path]
  85. <1> The first value in the `path.repo` setting is `E:\Mount\Backups`. This
  86. relative path, `My_fs_backup_location`, resolves to
  87. `E:\Mount\Backups\My_fs_backup_location`.
  88. // end::win[]