Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- BACKUPS_DIR="/Desktop/_backup/mongo"
- db_name="testando"
- host='127.0.0.1'
- date=$(date +"%d-%b-%Y-%H:%M:%S")
- cd $BACKUPS_DIR
- mongodump -h $host --archive=$db_name-$date.gz --gzip -d $db_name
- find $BACKUPS_DIR/* -mtime +30 -exec rm {} \;
- # Restore
- # mongorestore --gzip --archive=iboltt-22-Nov-2017-15:06:52.gz --db iboltt
Add Comment
Please, Sign In to add comment