Guest User

Untitled

a guest
Nov 24th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #!/bin/bash
  2. BACKUPS_DIR="/Desktop/_backup/mongo"
  3. db_name="testando"
  4. host='127.0.0.1'
  5. date=$(date +"%d-%b-%Y-%H:%M:%S")
  6. cd $BACKUPS_DIR
  7. mongodump -h $host --archive=$db_name-$date.gz --gzip -d $db_name
  8.  
  9. find $BACKUPS_DIR/* -mtime +30 -exec rm {} \;
  10.  
  11. # Restore
  12. # mongorestore --gzip --archive=iboltt-22-Nov-2017-15:06:52.gz --db iboltt
Add Comment
Please, Sign In to add comment