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

Commit

Permalink
Automatic snapshot naming elastic#7939
Browse files Browse the repository at this point in the history
extended doc: example is added. referring to indices date math more clearly
  • Loading branch information
Vladimir Dolzhenko committed May 11, 2018
1 parent 4b20260 commit b168ec8
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions docs/reference/modules/snapshots.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,26 @@ PUT /_snapshot/my_backup/snapshot_2?wait_for_completion=true
// TEST[continued]

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

Snapshot could be named according to the date that the snapshot made in a similar way as indices
using <<date-math-index-names,date math expressions>>, keep in mind all special characters should be URI encoded.

For example, following command creates a snapshot with a name like `snapshot-2018.05.11`:
[source,js]
-----------------------------------
# PUT /_snapshot/my_backup/<snapshot-{now/d}>
PUT /_snapshot/my_backup/%3Csnapshot-%7Bnow%2Fd%7D%3E
-----------------------------------
// CONSOLE
// TEST[continued]


The index snapshot process is incremental. In the process of making the index snapshot Elasticsearch analyses
the list of the index files that are already stored in the repository and copies only files that were created or
changed since the last snapshot. That allows multiple snapshots to be preserved in the repository in a compact form.
Expand Down

0 comments on commit b168ec8

Please sign in to comment.