Created
December 23, 2019 07:42
-
-
Save tsonglew/8c32d0cb79599cd4499eedd87c5d1b0a to your computer and use it in GitHub Desktop.
copy key from a redis to another
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#set connection data accordingly | |
source_host=*.*.*.* | |
source_port=6379 | |
target_host=*.*.*.* | |
target_port=6379 | |
passwd=redisPasswd | |
key=testKey | |
redis-cli --raw -h $source_host -p $source_port -a $passwd DUMP "$key" | head -c -1 | redis-cli -x -h $target_host -p $target_port -a $passwd RESTORE "$key" 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment