github.com/outbrain/consul@v1.4.5/website/source/docs/commands/snapshot.html.md (about) 1 --- 2 layout: "docs" 3 page_title: "Commands: Snapshot" 4 sidebar_current: "docs-commands-snapshot" 5 --- 6 7 # Consul Snapshot 8 9 Command: `consul snapshot` 10 11 The `snapshot` command has subcommands for saving, restoring, and inspecting the 12 state of the Consul servers for disaster recovery. These are atomic, point-in-time 13 snapshots which include key/value entries, service catalog, prepared queries, 14 sessions, and ACLs. This command is available in Consul 0.7.1 and later. 15 16 Snapshots are also accessible via the [HTTP API](/api/snapshot.html). 17 18 ## Usage 19 20 Usage: `consul snapshot <subcommand>` 21 22 For the exact documentation for your Consul version, run `consul snapshot -h` to 23 view the complete list of subcommands. 24 25 ```text 26 Usage: consul snapshot <subcommand> [options] [args] 27 28 # ... 29 30 Subcommands: 31 32 agent Periodically saves snapshots of Consul server state 33 inspect Displays information about a Consul snapshot file 34 restore Restores snapshot of Consul server state 35 save Saves snapshot of Consul server state 36 ``` 37 38 For more information, examples, and usage about a subcommand, click on the name 39 of the subcommand in the sidebar or one of the links below: 40 41 - [agent](/docs/commands/snapshot/agent.html) (Consul Enterprise only) 42 - [inspect](/docs/commands/snapshot/inspect.html) 43 - [restore](/docs/commands/snapshot/restore.html) 44 - [save](/docs/commands/snapshot/save.html) 45 46 ## Basic Examples 47 48 To create a snapshot and save it as a file called "backup.snap": 49 50 ```text 51 $ consul snapshot save backup.snap 52 Saved and verified snapshot to index 8419 53 ``` 54 55 To restore a snapshot from a file called "backup.snap": 56 57 ```text 58 $ consul snapshot restore backup.snap 59 Restored snapshot 60 ``` 61 62 To inspect a snapshot from the file "backup.snap": 63 64 ```text 65 $ consul snapshot inspect backup.snap 66 ID 2-5-1477944140022 67 Size 667 68 Index 5 69 Term 2 70 Version 1 71 ``` 72 73 To run a daemon process that periodically saves snapshots (Consul Enterprise only): 74 75 ``` 76 $ consul snapshot agent 77 ``` 78 79 For more examples, ask for subcommand help or view the subcommand documentation 80 by clicking on one of the links in the sidebar.