Skip to content

Instantly share code, notes, and snippets.

@raghothams
Created July 31, 2013 05:00
Show Gist options
  • Save raghothams/6119396 to your computer and use it in GitHub Desktop.
Save raghothams/6119396 to your computer and use it in GitHub Desktop.
shell script to backup DB from mongo
#!/bin/bash
cd ~/backups
folder=$(date +%Y%m%d)
mkdir $folder && cd $folder
mongodump -d sharurl
tar -cvf dump.tar.gz ./dump
rm -rf ./dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment