Context
I have a live running redis-server.
I want to make a backup.
Idea:
I want to do the following:
cp dump.rdb ~/some-other-location/06-24-2012.rdb ?
Concern
I don't see anything that promises me that dump.rdb is always a consistent database store. (I.e. it appears possible to me that while I am executing cp, redis is halfway through writing some piece of data, and thus dump.rdb is not in a consistent state.)
Problem:
This is bad, because I will now have to shut down the redis db in order to make a copy of dump.rdb
Question:
What is the correct way, while a redis-server is running, to make a live backup of the database? And what part of the manual promises me that this method creates a database that is in a consistent (not half written) state.
Thanks!
From http://redis.io/topics/persistence
So, the correct way is to simply copy the dump.rdb to your backup location.
If you using Amazon S3, it's very simple to backup Redis database with s3cmd tool.
s3cmd: http://s3tools.org/s3cmd
Tutorial: http://guchex.com/viniciusfbm/post/50/how-to-backup-redis-database-encrypted-to-s3-via-command-line-ubuntu