Created
June 14, 2016 14:39
-
-
Save leejones/34e7ca5952baa4fedf3df74a52f24b61 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
#!/bin/bash | |
host="$1" | |
workspace="/tmp/memcached-keys/$1" | |
rm -rf "$workspace" | |
mkdir -p "$workspace/items" | |
for item in $(echo "stats items" | nc "$host" 11211 | grep items | awk '{print $2}' | cut -d : -f 2 | sort -n | uniq); do | |
echo "stats cachedump $item 1000000" | nc "$host" 11211 > "$workspace/items/$item" | |
done | |
echo "INFO: Dumped keys to ${workspace}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment