github.com/outbrain/consul@v1.4.5/website/source/docs/commands/snapshot/save.html.markdown.erb (about)

     1  ---
     2  layout: "docs"
     3  page_title: "Commands: Snapshot Save"
     4  sidebar_current: "docs-commands-snapshot-save"
     5  ---
     6  
     7  # Consul Snapshot Save
     8  
     9  Command: `consul snapshot save`
    10  
    11  The `snapshot save` command is used to retrieve an atomic, point-in-time snapshot
    12  of the state of the Consul servers which includes key/value entries,
    13  service catalog, prepared queries, sessions, and ACLs. The snapshot is saved to
    14  the given file.
    15  
    16  If ACLs are enabled, a management token must be supplied in order to perform
    17  a snapshot save.
    18  
    19  ## Usage
    20  
    21  Usage: `consul snapshot save [options] FILE`
    22  
    23  #### API Options
    24  
    25  <%= partial "docs/commands/http_api_options_client" %>
    26  <%= partial "docs/commands/http_api_options_server" %>
    27  
    28  ## Examples
    29  
    30  To create a snapshot from the leader server and save it to "backup.snap":
    31  
    32  ```text
    33  $ consul snapshot save backup.snap
    34  Saved and verified snapshot to index 8419
    35  ```
    36  
    37  By default, snapshots are taken using a consistent mode that forwards requests
    38  to the leader and the leader verifies it is still in power before taking the
    39  snapshot.
    40  
    41  After the snapshot is written to the given file it is read back and verified for
    42  integrity.
    43  
    44  To create a potentially stale snapshot from any available server, use the stale
    45  consistency mode:
    46  
    47  ```text
    48  $ consul snapshot save -stale backup.snap
    49  # ...
    50  ```
    51  
    52  This is useful for situations where a cluster is in a degraded state and no
    53  leader is available. To target a specific server for a snapshot, you can run
    54  the `consul snapshot save` command on that specific server.
    55  
    56  Please see the [HTTP API](/api/snapshot.html) documentation for
    57  more details about snapshot internals.