Created
January 14, 2011 20:22
-
-
Save balibali/780167 to your computer and use it in GitHub Desktop.
mongodump で適当バックアップ用スクリプト
This file contains 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/sh | |
DAYNUMOFWEEK=$(date +%u) | |
# delete log file of the last week | |
if [ -f dump$DAYNUMOFWEEK.tar.gz ] | |
then | |
rm -v dump$DAYNUMOFWEEK.tar.gz | |
fi | |
# dump & compress mongo data | |
mongodump | |
tar czfv dump$DAYNUMOFWEEK.tar.gz dump | |
rm -rv dump |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment