Last active
September 5, 2017 15:34
-
-
Save ivodvb/efba63e3de99cddd9d1438a02fb1f1c2 to your computer and use it in GitHub Desktop.
Memcached key dump, use export MEMCACHED_HOST=localhost to set the host (see https://stackoverflow.com/questions/19560150/get-all-keys-set-in-memcached#comment73667943_35892919)
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
#!/bin/bash | |
echo -e "stats items\nquit" | nc $MEMCACHED_HOST 11211 | grep -oe ':[0-9]*:' | grep -oe '[0-9]*' | sort | uniq | xargs -L1 -I{} bash -c 'echo -e "stats cachedump {} 1000\nquit" | nc $MEMCACHED_HOST 11211' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment