Code Blockexcerpt |
---|
redis-cli is a useful tool can handle Redis KEYs in the system. You can search / delete / get / clear / check its status simple on your terminal. |
Table of Contents |
---|
...
redis_clear.sh
...
Note that you can use special characters like $. Example) PROD_lock_*
redis_get.sh
Code Block |
---|
#!/bin/bash
redis-cli -h hostname -p port_number -a passphrase --scan --pattern $1 | xargs redis-cli -h hostname -p port_number -a passphrase GET |
redis_delete.sh
Code Block |
---|
#!/bin/bash
if [ "$1" ];
then
redis-cli -h hostname -p port_number -a passphrase --scan --pattern $1 | xargs redis-cli DEL
else
echo "Usage: $0 <key>"
fi |
...