Back to Redis

LASTSAVE

content/commands/lastsave.md

latest1.2 KB
Original Source

Return the UNIX TIME of the last DB save executed with success. A client may check if a [BGSAVE]({{< relref "/commands/bgsave" >}}) command succeeded reading the LASTSAVE value, then issuing a [BGSAVE]({{< relref "/commands/bgsave" >}}) command and checking at regular intervals every N seconds if LASTSAVE changed. Redis considers the database saved successfully at startup.

Redis Software and Redis Cloud compatibility

| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Not supported">❌ Standard</span> <span title="Not supported"><nobr>❌ Active-Active</nobr></span> | <span title="Not supported">❌ Standard</span> <span title="Not supported"><nobr>❌ Active-Active</nobr></span> | |

Return information

{{< multitabs id="lastsave-return-info" tab1="RESP2" tab2="RESP3" >}}

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

-tab-sep-

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

{{< /multitabs >}}