摘要: Mongodb用的是可以热备份的mongodump和对应恢复的mongorestore,在linux下面使用shell脚本写的定时备份,代码如下1.定时备份#!/bin/bashsourcepath='/app/mongodb-linux-x86_64-2.4.1'/bintargetpath='/backup/mongobak'nowtime=$(date +%Y%m%d)start(){ ${sourcepath}/mongodump --host 127.0.0.1 --port 27017 --out ${targetpath}/${nowtime}}e 阅读全文
posted @ 2013-06-21 17:41 变异爬行者 阅读(6075) 评论(0) 推荐(0) 编辑
摘要: 1.syntax error near unexpected token `then'if后要有空格,[] 中括号的开头和结尾要有空格! [ $1-eq"root" ]中括号中的$1和-eq和"root"之间没有空格! 阅读全文
posted @ 2013-06-21 16:09 变异爬行者 阅读(152) 评论(0) 推荐(0) 编辑