open-consul/website/pages/commands/snapshot/index.mdx
Jasmine W 8ae3332165
docs: update structure (#8506)
- moved and renamed files/folders based on new structure
- updated docs navigation based on new structure
- moved CLI to top nav (created commands.jsx and commands-navigation.js)
- updated and added redirects
- updating to be consistent with standalone categories
- changing "overview" link in top nav to lead to where intro was moved (docs/intro)
- adding redirects for intro content
- deleting old intro folders
- format all data/navigation files
- deleting old commands folder
- reverting changes to glossary page
- adjust intro navigation for removal of 'vs' paths
- add helm page redirect
- fix more redirects
- add a missing redirect
- fix broken anchor links and formatting mistakes
- deleted duplicate section, added redirect, changed link
- removed duplicate glossary page
2020-09-01 11:14:13 -04:00

81 lines
2.1 KiB
Plaintext

---
layout: commands
page_title: 'Commands: Snapshot'
sidebar_title: snapshot
---
# Consul Snapshot
Command: `consul snapshot`
The `snapshot` command has subcommands for saving, restoring, and inspecting the
state of the Consul servers for disaster recovery. These are atomic, point-in-time
snapshots which include key/value entries, service catalog, prepared queries,
sessions, and ACLs. This command is available in Consul 0.7.1 and later.
Snapshots are also accessible via the [HTTP API](/api/snapshot).
## Usage
Usage: `consul snapshot <subcommand>`
For the exact documentation for your Consul version, run `consul snapshot -h` to
view the complete list of subcommands.
```text
Usage: consul snapshot <subcommand> [options] [args]
# ...
Subcommands:
agent Periodically saves snapshots of Consul server state
inspect Displays information about a Consul snapshot file
restore Restores snapshot of Consul server state
save Saves snapshot of Consul server state
```
For more information, examples, and usage about a subcommand, click on the name
of the subcommand in the sidebar or one of the links below:
- [agent](/docs/commands/snapshot/agent) <EnterpriseAlert inline />
- [inspect](/docs/commands/snapshot/inspect)
- [restore](/docs/commands/snapshot/restore)
- [save](/docs/commands/snapshot/save)
## Basic Examples
To create a snapshot and save it as a file called "backup.snap":
```shell-session
$ consul snapshot save backup.snap
Saved and verified snapshot to index 8419
```
To restore a snapshot from a file called "backup.snap":
```shell-session
$ consul snapshot restore backup.snap
Restored snapshot
```
To inspect a snapshot from the file "backup.snap":
```shell-session
$ consul snapshot inspect backup.snap
ID 2-5-1477944140022
Size 667
Index 5
Term 2
Version 1
```
To run a daemon process that periodically saves snapshots <EnterpriseAlert inline />
```shell-session
$ consul snapshot agent
```
For more examples, ask for subcommand help or view the subcommand documentation
by clicking on one of the links in the sidebar.