Skip to content
This repository was archived by the owner on Sep 24, 2019. It is now read-only.

Commit b168ec8

Browse files
author
Vladimir Dolzhenko
committed
Automatic snapshot naming elastic#7939
extended doc: example is added. referring to indices date math more clearly
1 parent 4b20260 commit b168ec8

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

docs/reference/modules/snapshots.asciidoc

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,14 +282,26 @@ PUT /_snapshot/my_backup/snapshot_2?wait_for_completion=true
282282
// TEST[continued]
283283

284284
The list of indices that should be included into the snapshot can be specified using the `indices` parameter that
285-
supports <<multi-index,multi index syntax>>. It can be useful to use <<date-math-index-names,date math>> to name the
286-
snapshot according to the date that the snapshot made, e.g. `snapshot-2018.05.09`. The snapshot request also supports the
285+
supports <<multi-index,multi index syntax>>. The snapshot request also supports the
287286
`ignore_unavailable` option. Setting it to `true` will cause indices that do not exist to be ignored during snapshot
288287
creation. By default, when `ignore_unavailable` option is not set and an index is missing the snapshot request will fail.
289288
By setting `include_global_state` to false it's possible to prevent the cluster global state to be stored as part of
290289
the snapshot. By default, the entire snapshot will fail if one or more indices participating in the snapshot don't have
291290
all primary shards available. This behaviour can be changed by setting `partial` to `true`.
292291

292+
Snapshot could be named according to the date that the snapshot made in a similar way as indices
293+
using <<date-math-index-names,date math expressions>>, keep in mind all special characters should be URI encoded.
294+
295+
For example, following command creates a snapshot with a name like `snapshot-2018.05.11`:
296+
[source,js]
297+
-----------------------------------
298+
# PUT /_snapshot/my_backup/<snapshot-{now/d}>
299+
PUT /_snapshot/my_backup/%3Csnapshot-%7Bnow%2Fd%7D%3E
300+
-----------------------------------
301+
// CONSOLE
302+
// TEST[continued]
303+
304+
293305
The index snapshot process is incremental. In the process of making the index snapshot Elasticsearch analyses
294306
the list of the index files that are already stored in the repository and copies only files that were created or
295307
changed since the last snapshot. That allows multiple snapshots to be preserved in the repository in a compact form.

0 commit comments

Comments
 (0)