redis骚操作

1.批量删除key

redis-cli -h 127.0.0.1 -p 6379 -n 2 -a sdongpo123 keys '*form_id*' | xargs redis-cli -h 127.0.0.1  -p 6379 -a sdongpo123 -n 2 del

2.批量修改key的过期时间:

redis-cli -h 127.0.0.1 keys "pre:key_*" | xargs -i redis-cli -h 127.0.0.1 expire {} 86400

猜你喜欢

转载自www.cnblogs.com/mikeluwen/p/10362585.html
今日推荐