Skip to content

Instantly share code, notes, and snippets.

@zinovyev
Created February 9, 2017 17:27
Show Gist options
  • Save zinovyev/e99384f2672f6705764ebd26330c51df to your computer and use it in GitHub Desktop.
Save zinovyev/e99384f2672f6705764ebd26330c51df 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