LASTSAVE
LASTSAVE
- Group
- Server
- Complexity
- O(1)
- Arity
- 1 (exactly, counting the command name)
- Flags
- read-only, fast
- HotKV Cloud
- All plans
- On-Premise
- no license needed
LASTSAVE returns when the last snapshot was successfully written, by
SAVE, BGSAVE, a save point or a
shutdown. Before the first save it returns the time the server started.
A common way to confirm a background save finished is to read LASTSAVE,
run BGSAVE, and poll LASTSAVE until it changes.
Return value
Section titled “Return value”An integer: Unix time in seconds, in RESP2 and RESP3.
Examples
Section titled “Examples”127.0.0.1:6379> LASTSAVE(integer) 1789996400127.0.0.1:6379> BGSAVEBackground saving started127.0.0.1:6379> LASTSAVE(integer) 1790000000Compatibility
Section titled “Compatibility”Same as Redis 7 and Valkey 8.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.