#!/usr/bin/env python
#coding:utf-8
import os
import sys
def start():
os.system('/usr/local/mongodb/bin/mongod -f /usr/local/mongodb/conf/mongodb.conf')
def stop():
os.system('/usr/local/mongodb/bin/mongod --shutdown --dbpath /data/mongodb/db')
def status():
os.system('ps aux | grep mongod | grep -v grep')
def callable(input_key):
service_option = {'start': start, 'stop': stop, 'status': status}
return service_option[input_key]()
input_key=sys.argv[1]
callable(input_key)
python开发mongodb启动脚本
原创
©著作权归作者所有:来自51CTO博客作者小杨同学THY的原创作品,请联系作者获取转载授权,否则将追究法律责任
下一篇:python更新游戏程序

提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
python操作mongodb
python操作mongodb
mongodb python -
jenkins通过脚本启动java应用
本文简单简单介绍怎么通过jenkins来调用shell脚本启动java脚本。
html/xml shell -
mongodb启动脚本
mongodb配置文件和启动脚本
启动脚本 mongodb -
MongoDB的服务启动脚本!
本文简单介绍了MongoDB的服务启动脚本!
MongoDB 启动脚本 -
Shell开发rsync启动脚本
本文章讲述如何使用Shell 开发rsync启动脚本
rsync 启动脚本 shell linux -
开发rsync启动脚本2
使用函数更加规范的开发rsync启动脚本 执行结果:
bash 启动脚本 vim