Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Excerpt

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.

...

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

...