What's new in Valkey 9.0? Discover new features and improvements. Read the announcement.

LASTSAVE

Returns the Unix timestamp of the last successful save to disk.

Usage
LASTSAVE
Complexity
O(1)
Since
1.0.0
ACL Categories
@admin, @dangerous, @fast
Command flags
LOADING, STALE, FAST

Return the UNIX TIME of the last DB save executed with success. A client may check if a BGSAVE command succeeded reading the LASTSAVE value, then issuing a BGSAVE command and checking at regular intervals every N seconds if LASTSAVE changed. Valkey considers the database saved successfully at startup.

Replies

RESP2

Integer reply: UNIX TIME of the last DB save executed with success.

RESP3

Integer reply: UNIX TIME of the last DB save executed with success.