Skip to content

Instantly share code, notes, and snippets.

@slavone
Forked from zinovyev/redis-dump.sh
Created February 10, 2017 08:14
Show Gist options
  • Save slavone/45780e9050ea7d7b34a276ea31320e3b to your computer and use it in GitHub Desktop.
Save slavone/45780e9050ea7d7b34a276ea31320e3b to your computer and use it in GitHub Desktop.
Redis dump in bash
#! /usr/bin/env bash
redis-cli KEYS "*" | awk "{print \"echo \\\"RESTORE \"\$1\" 0 \`redis-cli --csv DUMP \\\"\"\$1\"\\\"\` \\\" \"}" | bash > dump.bkp
# to restore use: cat dump.bkp | redis-cli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment