SAVE
SAVE
- Group
- Server
- Complexity
- O(N) where N is the number of keys
- Arity
- 1 (exactly, counting the command name)
- Flags
- admin
- HotKV Cloud
- All plans
- On-Premise
- no license needed
SAVE writes a point-in-time snapshot of every database to the snapshot
file (dbfilename in dir) and replies when the file is complete. The
connection that sent it waits for the whole write, so on a large data set
prefer BGSAVE, which replies at once and saves in the
background.
A successful SAVE updates LASTSAVE and resets
rdb_changes_since_last_save in INFO persistence.
Return value
Section titled “Return value”| Case | Reply (RESP2 and RESP3) |
|---|---|
| Snapshot written | Simple string OK |
| A background save is running | Error ERR Background save already in progress |
| The file could not be written | Error ERR Saving the snapshot failed, check the server log |
Examples
Section titled “Examples”127.0.0.1:6379> SAVEOK127.0.0.1:6379> LASTSAVE(integer) 1790000000Compatibility
Section titled “Compatibility”Same replies as Redis 7 for the success case. HotKV’s snapshot file format is
its own (the default file name is dump.hkv); see
persistence.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.