Skip to content

Instantly share code, notes, and snippets.

View yanshengjia's full-sized avatar
🏠
Working from home

Shengjia Yan yanshengjia

🏠
Working from home
View GitHub Profile
@yanshengjia
yanshengjia / mongo_backup_and_clear.sh
Created November 29, 2018 10:54
MongoDB backup and clear
#!/bin/bash
MONGO_DATABASE="annotation"
MONGO_HOST="10.0.5.40"
MONGO_PORT="27017"
TIMESTAMP=`date +%Y-%m-%d-%H-%M-%S`
MONGODUMP_PATH=/usr/bin/mongodump
BACKUPS_DIR=~/sjyan/data/mongodb-backup/
BACKUP_NAME=$TIMESTAMP
SCRIPT_DIR=~/sjyan/scripts/