keys teacher_sso_username*
ttl teacher_sso_username:13444444416
redis-cli -h 127.0.0.1 -p 6379 -a Cg44uwsgsgsg1 expire $1 1296000
redis-cli -h 127.0.0.1 -p 6379 -a Cg44uwsgsgsg1 keys "support_sso_userinfo*" | xargs -I {} ./expireAll.sh {}
脚本内容:
#!/bin/bash
redis-cli -h 127.0.0.1 -p 6379 -a Cg44uh6I96f0RPb1 expire $1 554715
第二种(批量删除缓存):
redis-cli -h 127.0.0.1 -p 6379 -a Cg44uh6I96f0RPb1 keys "student_sso_username*" | xargs redis-cli -h 127.0.0.1 -p 6379 -a Cg44uh6I96f0RPb1 del