Introduction
Any production system should include a provision for taking regular backups. Vault Enterprise can be configured to take and store snapshots at regular intervals.
Prerequisites
"Automated snapshots" is a feature of Vault Enterprise. An appropriate Vault Enterprise license is required.
Challenge
There can be multiple named snapshot configurations, each with its own schedule and storage type. It is possible to list all the named snapshots that are configured. This will return only a list of the named snapshots.
vault list sys/storage/raft/snapshot-auto/config
Once the list of named snapshot configurations has been obtained, it is then possible to read the configuration of each individual named snapshot:
vault read sys/storage/raft/snapshot-auto/config/<snapshot config name>
In the case where there are many named snapshot configurations, you may want to obtain the configuration of all the named snapshots in a single action rather than individually.
Solution
The following command will determine the names of all configured automated snapshots and provide their configurations.
vault list -format=json sys/storage/raft/snapshot-auto/config | \
jq -r ".[]" | \
xargs -I{} sh -c 'echo {} && vault read -format=json sys/storage/raft/snapshot-auto/config/{}'The outcome of the above is the configuration details of all configured Raft auto snapshots.
Note: jq is an external tool that may not necessarily be available on the Vault server.
Additional References
Vault Documentation: Vault Snapshots with integrated storage
Vault Documentation: List Automated snapshots configured
Vault Documentation: Read Automated snapshot configuration
Vault Documentation: Raft Automated Snapshot API