0

How can I tell if memcache was flushed programatically?

If I issues a echo flush_all | netcat localhost 11211 to memcache how can I tell it actually worked? I am writing some code to flush all servers and want to make sure they all received the command.

Elijah Lynn
  • 139
  • 3
  • 16
  • Mostly asking this because I didn't see any results in Google and I know I will come across this again in a year or so. – Elijah Lynn Jul 28 '16 at 17:27

1 Answers1

1

So far it seems as one way to do it is to echo stats | netcat localhost 11211 and look at STAT cmd_flush and see if the number has incremented.

`echo stats | netcat localhost 11211 | sed --silent '/cmd_flush/p'

I can then compare this and see if it changed.

Elijah Lynn
  • 139
  • 3
  • 16