Last active
February 21, 2018 17:02
-
-
Save gravcat/86cbe33ffc1a22d7ea55f732ef807f84 to your computer and use it in GitHub Desktop.
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/bash | |
# export deployment info from mcp | |
timestamp=$(date +"%Y%m%d-%H%M") | |
# create directory in home based on timestamp like 20180221-1058, cd into | |
mkdir ~/$timestamp | |
cd ~/$timestamp | |
# export data from mongo | |
mongoexport --db=mcp --collection=DeploymentHistory --out DeploymentHistory.json | |
mongoexport --db=mcp --collection=Deployments --out Deployments.json | |
# hop back out and archive | |
cd ~ | |
tar cvzf ~/$timestamp.tgz ~/$timestamp/ | |
rm -rf ~/$timestamp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment