redis从db1复制到db3


```powershell
#!/bin/bash
redis-cli -h 127.0.0.1 -p 6379 -a password -n 1 keys "*" | while read key
do
        redis-cli -h 127.0.0.1 -p 6379 -a password -n 1 --raw dump $key | perl -pe 'chomp if eof' | redis-cli -h 127.0.0.1 -p 6379 -a Gobest@redis -n 3 -x restore $key 0
        echo "migrate key $key"
done

你可能感兴趣的:(redis,linux,redis,数据库,database)