Skip to content

Instantly share code, notes, and snippets.

@elhoyos
Created January 4, 2018 21:02
Show Gist options
  • Save elhoyos/a3d7c27c717741a5bab58141c065f29f to your computer and use it in GitHub Desktop.
Save elhoyos/a3d7c27c717741a5bab58141c065f29f to your computer and use it in GitHub Desktop.
Export/Import remote redis data
$ ssh redis-server "redis-cli -h redis.host.com --csv hgetall {s0m3key}" | \
awk -F, '{ gsub(/","/,"\" \"",$0); print "HMSET", "{s0m3key}", $0 }' - | redis-cli --pipe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment