【问题标题】:Can I clear an NCache cache without confirmation?我可以在不确认的情况下清除 NCache 缓存吗?
【发布时间】:2016-05-07 05:54:59
【问题描述】:

我有一个 NCache 实现(在一对服务器上以复制格式配置,如果这有什么不同的话)并且我想编写脚本来清除缓存。我有一个 powershell 脚本,它使用适当的参数调用 NCache clearcache.exe 工具(在 \bin\tools 中),但该工具随后会提示我确认我确实确实想要清除非空缓存(为什么是,我愿意!)。

我查看了命令的内联帮助(很少)和在线 NCache 文档 (http://www.alachisoft.com/resources/docs/ncache/help/main.html) 中没有任何关于其他参数(如 --force 选项等)的帮助。

有没有这样的选项可以让我在不与脚本交互的情况下清除缓存?是否有其他途径可以完成同样的事情?

【问题讨论】:

标签: powershell command-line ncache


【解决方案1】:

如果您查看第 35 页 here(NCache 命令行工具指南),您会发现可以使用 /F 强制清除缓存。

【讨论】:

  • 我发现“/F”是区分大小写的;使用小写字母时,我收到一个关于未在客户端配置中配置服务器详细信息的错误(尽管它们是)。切换到大写即可解决问题。
【解决方案2】:

打开 CMD 并转到 NCache 安装文件夹然后 bin/tools 对我来说是C:\Program Files\NCache\bin\tools

运行clearcache.exe /?你会得到

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.

用法:clearcache cache-name [option[...]].

论据:

缓存名称

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.

选项:

/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

所以使用 /F 或完整形式的 /forceclearoption 运行 clearcache

【讨论】:

  • 好吧,在我们运行的 ncache 版本中,/F 选项不会出现在 /?帮助,所以这对我们没有帮助。 @David Brabant 的回答为我们指出了在线的实际文档。
  • 这很奇怪。你能打开一个问题吗? github.com/Alachisoft/NCache/issues
  • 当然,我们使用的是 4.4,所以也许这就是问题所在。
  • 嗯,它应该在那里。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-01-14
  • 2020-10-21
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多