Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Flush all keys from memcached server
#!/usr/bin/expect --
# Purge local memcache, flushing all the keys & values
set escapechar !; # easier to send than default ^]
set host [lindex $argv 1];
if { ![string length $host] } {
set host "localhost";
}
set port [lindex $argv 2];
if { ![string length $port] } {
set port "11211";
}
spawn telnet -e $escapechar "$host" $port;
expect "Connected to $host";
send "flush_all\n";
send $escapechar;
expect "telnet>";
send "quit\n";
wait;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.