This repository has been archived by the owner on May 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 76
BACKUP
Josh Baker edited this page Oct 17, 2016
·
1 revision
Retrieve a backup of the database.
Bulk string reply: The connection will be closed immediately following a successful transfer.
> BACKUP
BULK REPLY OF DATA
Or using an HTTP connection like such:
curl localhost:7481/backup -o backup.db
The backup file format is a series of commands which are stored as RESP Arrays. The command:
SET mykey 123
Is stored on disk as:
"*3\r\n$3\r\nSET\r\n$5\r\nmykey\r\n$3\r\n123\r\n"
To restore a system from a backup, issue each command to the leader. For example, using the nc
command you could execute:
$ cat backup.db | nc localhost 7481