#!/bin/bash
#######################MONGODB BACKUP SCRIPTS########################
BACKUP_PATH="/usr/dump/mongodb"
DATE=`date +%Y%m%d_%I%M`
TAR_NAME="mongo_Bak$DATE.tar.gz"
TAR_IN="diodb"
DB_HOST="***"
DB_NAME="***"
DB_USER="***"
DB_PASS="***"
cd $BACKUP_PATH
mongodump -h $DB_HOST -d $DB_NAME -u $DB_USER -p $DB_PASS -o $BACKUP_PATH
tar -czvf $TAR_NAME $TAR_IN
Mongodb 备份shell
最新推荐文章于 2024-06-21 16:45:18 发布