###############
备份脚本
#!/bin/bash
basepath="/data/backup/dump$(date +%Y%m%d%H%M%S)"
if [ ! -d "$basepath" ]; then
mkdir -p "$basepath"
fi /usr/local/mongo/bin/mongodump --port -u "user" -p "password" --gzip --authenticationDatabase "admin" -o $basepath find /data/backup/ -mtime + -name "dump*" -exec rm -rf {} \;