Redis如何打包执行多条命令

Redis如何打包执行多条命令

批量执行 redis 命令
准备 redis 命令文件
例如: redis-command.txt 里边有 N 条 redis 命令(建议最好不要超过 20MB,不然执行过程会中断)
执行 redis 命令文件
cat redis-command.txt | redis-cli -h localhost -p 6379 -a 123456
1
-h: 参数表示 redis 主机 IP;
-p: 参数表示 redis 服务端口号;
-a: 参数表示 redis 的密码;

你可能感兴趣的:(redis)