Skip to content

Snapshots

A snapshot is a JSON export of one namespace at one moment.

/saunacache snapshot leaderboards

The file goes to plugins/SaunaCache/snapshots/leaderboards-<timestamp>.json:

{
"namespace": "leaderboards",
"taken": "2026-10-12T18:04:11Z",
"keys": [
{ "key": "kills", "type": "sorted-set", "ttl": 3412, "value": [["Steve", 41.0], ["Alex", 37.0]] }
]
}

/saunacache restore <file> writes every key from the snapshot back, overwriting existing ones. Keys whose TTL has run out since the snapshot are skipped.

snapshots:
schedule: "0 4 * * *" # cron, server time
namespaces: [leaderboards]
keep: 7

Only one server of the network should have a schedule, otherwise every server writes its own copy.