[shell]管理 Sphinx 启动|停止|重新生成索引的脚本
2011-08-25 15:12
543 查看
因为工作需要,所以把管理 Sphinx 的相关操作写成一个管理脚本,方便日常使用。
使用方法:
启动服务 sphinx start
停止服务 sphinx stop
重新生成搜索 sphinx restart
#!/bin/sh #file: /usr/local/bin/sphinx # #~ power by yagas60@21cn.com #~ blog: http://blog.csdn.net/yagas . /etc/rc.d/init.d/functions appName="Sphinx" stop(){ /usr/local/bin/searchd -c /usr/local/coreseek/etc/sphinx.conf --stop > /dev/null 2>&1 ret=$? if [ $ret -eq 0 ]; then action $"Stoping $appName: " /bin/true else action $"Stoping $appName: " /bin/false fi return $ret } start(){ /usr/local/bin/searchd -c /usr/local/coreseek/etc/sphinx.conf > /dev/null 2>&1 ret=$? if [ $ret -eq 0 ]; then action $"Starting $appName: " /bin/true else action $"Starting $appName: " /bin/false fi return $ret } indexer(){ /usr/local/bin/indexer -c /usr/local/coreseek/etc/sphinx.conf --all > /dev/null 2>&1 ret=$? if [ $ret -eq 0 ]; then action $"$appName making index: " /bin/true else action $"$appName making index: " /bin/false fi return $ret } case $1 in restart) stop indexer start ;; stop) stop ;; start) start ;; esac exit 0
使用方法:
启动服务 sphinx start
停止服务 sphinx stop
重新生成搜索 sphinx restart
相关文章推荐
- [shell]管理 Sphinx 启动|停止|重新生成索引的脚本
- linux使用shell脚本管理其他服务器Tomcat启动停止、自动发布
- shell脚本生成服务演示服务启动、停止过程。
- linux环境在tomcat启动或者停止后执行shell脚本,脚本内容备份图片文件夹
- 使用交互式shell脚本实现对DNS服务的管理以及启动
- Linux下启动和停止Java应用程序的Shell脚本
- 编写启动程序和停止程序的shell脚本
- 【甘道夫】Hadoop2.2.0集群启动和停止Shell脚本
- linux启动java进程的shell脚本(包括启动,停止,重启)
- shell脚本控制jar的启动和停止
- linux--shell脚本批量启动和停止jar包
- shell脚本启动,停止java应用程序
- Linux 下Java 进程启动停止shell脚本
- Linux手动启动、停止多个服务用的shell脚本
- linux--shell脚本启动和停止jar包
- linux环境下编写shell脚本实现启动停止tomcat服务的方法
- Shell脚本_启动停止重启sh脚本
- openvswitch 2.1.2 安装完成后 启动 与 停止 shell脚本
- shell脚本控制jar的启动和停止 - Linux,shell,脚本控制jar包启动停止 - language - ITeye论坛
- 启动和停止Java应用程序的Shell脚本