mongodb 备份脚本
时间:2021-07-01 10:21:17
帮助过:3人阅读
=
"/data/backup/dump$(date +%Y%m%d%H%M%S)"
if [ ! -d
"$basepath" ];
then
mkdir -p
"$basepath"
fi
/usr/local/mongo/bin/mongodump --port
27017 -u
"user" -p
"password" --
gzip --authenticationDatabase
"admin" -
o $basepath
find /data/backup/ -mtime +
30 -name
"dump*" -exec
rm -rf {} \;
mongodb 备份脚本
标签:auth pat admin ati find port back mongo ica