2

I've got an NCache implementation (configured in replicated format across a pair of servers, if that makes any difference) and I want to script clearing the cache. I've got a powershell script that calls the NCache clearcache.exe tool (in \bin\tools) with the appropriate parameters, but the tool then prompts me for confirmation that I actually do want to clear a non-empty cache (why yes, I do!).

I've looked at the inline help for the command (scanty) and in the NCache documentation online (http://www.alachisoft.com/resources/docs/ncache/help/main.html) without any luck for help with additional parameters (like a --force option or the like).

Is there any such option that would allow me to clear the cache without having to interact with the script? Is there another path to accomplishing the same thing?

cori
  • 8,666
  • 7
  • 45
  • 81

2 Answers2

2

If you look at page 35 here (NCache Command Line Tools guide), you'll see that you can use /F to force a clear cache.

David Brabant
  • 41,623
  • 16
  • 83
  • 111
  • I found that the "/F" was case sensitive; using lower case I received an error about the server details not being configured in the client config (although they were). Switching to upper case resolved the issue. – cori Jan 29 '16 at 15:48
2

Open CMD and go to NCache installation folder then bin/tools For me it's C:\Program Files\NCache\bin\tools

run clearcache.exe /? you'll get

C:\Program Files\NCache\bin\tools>clearcache.exe /?

Alachisoft (R) NCache Utility ClearCache. Version 4.6.0.0 
Copyright (C) Alachisoft 2015. All rights reserved.

Usage: clearcache cache-name [option[...]].

Argument:

cache-name(s)

Specifies one or more name(s) of caches separated by space registered on
the server. The cache(s) with this/these name(s) is/are started on the
server. Note: Space-separated cache names are to be specified in case of
multiple caches.

Option:

/w /webcontent (Only avaiable in Enterprise edition)
Clear Javascript and CSS only.

/F /forceclear

Force the clearing of the cache. If not specified, the user is asked before
clearing the cache.

/G /nologo

Suppresses display of the logo banner.

/?

Displays a detailed help screen

so run clearcache with the /F or in full form /forceclearoption

Basit Anwer
  • 6,742
  • 7
  • 45
  • 88