Created
November 13, 2013 07:53
-
-
Save nassor/7445313 to your computer and use it in GitHub Desktop.
Backup and compact a MongoDB database
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd /data/backups/ | |
mongodump -d <dbname> | |
today=$(date +"%Y%m%d") && tar cvzf "<dbname>-$today.tar.gz" dump/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment