mongodb 简单的备份

#!/bin/sh
binpath="/usr/local/mongodb/bin"
backpath="/data1/mongodbgwy/back"
port=29017
$binpath/mongodump  --port $port -o  $backpath/mongodb_`date +%Y%m%d`
find $backpath/* -type d  -prune -mtime 30  -name mongodb*  -exec rm -rf {} \;

你可能感兴趣的:(mongodb)