Advertisement
Beginner Redis, Redis Backup & Disaster Recovery

How do you create a manual backup of your Redis data at a specific point in time?

Short answer

You use the SAVE command to synchronously create an RDB snapshot file, or the BGSAVE command to create the same snapshot in the background without blocking other operations, and then copy that resulting RDB file to a safe backup location such as another server or cloud storage.

Save Redis mock interview
Advertisement
AModel answer
You use the SAVE command to synchronously create an RDB snapshot file, or the BGSAVE command to create the same snapshot in the background without blocking other operations, and then copy that resulting RDB file to a safe backup location such as another server or cloud storage.
Example

BGSAVE -- Wait for it to complete, then copy the resulting file cp /var/lib/redis/dump.rdb /backups/redis_backup_20260907.rdb

Real-world example
A team schedules a nightly BGSAVE followed by copying the resulting RDB file to an off site cloud storage location, ensuring they always have a recent, safely stored backup available if disaster strikes.
Likely follow-ups
  • How do you verify that a backup RDB file is not corrupted?
  • Where should backup files ideally be stored for maximum safety?
Related topics