0

According to Redis official documentation:

LASTSAVE Return the UNIX TIME of the last DB save executed with success.

However, when I execute LASTSAVE I get the timestamp of the last restored backup instead of the last DB save executed. In other words, if I did a backup yesterday and I restore it today, LASTSAVE will give me a timestamp from today.

My problem is that I actually need the unix timestamp of when the last backup was made and not the timestamp of when the backup was restored.

cristobal
  • 1
  • 1
  • But then, I am wondering if this is really a question about *programming*, or about how to properly do administration work for your database. In that case, https://dba.stackexchange.com/ might be a better fit for your question. – GhostCat Oct 31 '18 at 14:01
  • 1
    Thanks @GhostCat. Now that I think about it, it would be better to ask this to Redis staff, as it is related to a specific Redis functionality (as you said, it's not about programming) – cristobal Oct 31 '18 at 18:02

1 Answers1

0

When Redis restarts, it resets the LASTSAVE time as the current time.

I actually need the unix timestamp of when the last backup was made and not the timestamp of when the backup was restored

You can get the last backup time by checking the dump.rdb file's last modified time.

for_stack
  • 21,012
  • 4
  • 35
  • 48