-
-
Save jose-daniel/72a18627f03cd44102bf4f1018ff2209 to your computer and use it in GitHub Desktop.
This file contains 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
A COLLECTION OF REDIS-CLI COMMANDS | |
PRODUCTION SAFE COMMANDS | |
Key pattern size sum | |
redis-cli -n ##DATABASE_ID## -p ##REDIS_PORT## --scan --pattern "*##PATTERN##*" | xargs -L 1 redis-cli -n ##DATABASE_ID## -p ##REDIS_PORT## --raw STRLEN | awk '{s+=$1} END {print s}' | |
Delete key pattern | |
redis-cli -n ##DATABASE_ID## -p ##REDIS_PORT## --scan --pattern "*##PATTERN##*" | xargs -L 10 redis-cli -n ##DATABASE_ID## -p ##REDIS_PORT## DEL | |
Delete hashmap without burning the database | |
for((i=1;i<=XXXXXXXXX;i+=1)); do echo "$i"; done|xargs -L 10 redis-cli -n 0 -p 6380 -h 172.16.4.4 HDEL CACHE_KEY:ENVIRONMENT:LANGCODE | |
NOTE: don't forget the last space at the end of the line (after the key) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment