python开发mongodb启动脚本

#!/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启动脚本
标题URL:http://lszwz.com/article/jcseho.html

其他资讯

售后响应及时

7×24小时客服热线

数据备份

更安全、更高效、更稳定

价格公道精准

项目经理精准报价不弄虚作假

合作无风险

重合同讲信誉,无效全额退款