-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add backups section to mongodbent docs. #94
Open
tstjep
wants to merge
3
commits into
swisscom:master
Choose a base branch
from
tstjep:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,3 +116,6 @@ On the MongoDB Ops Manager you will receive the role `Monitoring Admin`. | |
- Consider a query timeout | ||
|
||
MongoDB targets operations for termination if the associated cursor exceeds its allotted time limit. See [cursor.maxTimeMS()](https://docs.mongodb.com/manual/reference/method/cursor.maxTimeMS/) for more details. | ||
|
||
## <a id='backups'></a> Backups | ||
You can use following app to create and restore backups in a scheduled way: backman - the appcloud backup manager. Any MongoDB service instance bound to this app will be automatically backed up, can be downloaded and also restored on-demand. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and also restored on-demand. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
# check input params, s3cmd config, installed dependencies | ||
if [ -z "$*" ]; then echo "Usage: s3cleanup.sh ORG SPACE SERVICE_NAME"; exit 1; fi | ||
if [ -f $HOME/.s3cfg ]; then echo "s3cmd config $HOME/.s3cfg already exists, please rename temporarily. Aborting."; exit 1; fi | ||
command -v cf >/dev/null 2>&1 || { echo >&2 "cf cli not installed. Aborting."; exit 1; } | ||
command -v s3cmd >/dev/null 2>&1 || { echo >&2 "s3cmd not installed. Aborting."; exit 1; } | ||
command -v jq >/dev/null 2>&1 || { echo >&2 "jq not installed. Aborting."; exit 1; } | ||
|
||
#read input params | ||
org=$1 | ||
space=$2 | ||
service=$3 | ||
|
||
#change to org/space and create temporary service key | ||
cf t -o $org -s $space | ||
cf csk $service tempkey | ||
|
||
#parse s3cmd config from service key | ||
service_key=`cf service-key $service tempkey|tail -n 8` | ||
access_key=`echo $service_key|jq -r .accessKey` | ||
host_base=`echo $service_key|jq -r .namespaceHost|cut -d "." -f 2-4` | ||
host_bucket=`echo $service_key|jq -r .namespaceHost` | ||
secret_key=`echo $service_key|jq -r .sharedSecret` | ||
|
||
#heredoc to create s3cmd config in the users homedir | ||
echo "Creating $HOME/.s3cfg" && cat << EOF > $HOME/.s3cfg | ||
[default] | ||
access_key = $access_key | ||
host_base = $host_base | ||
host_bucket = $host_bucket | ||
secret_key = $secret_key | ||
EOF | ||
|
||
#delete all buckets | ||
echo "Trying to delete all files/buckets on $service." | ||
s3cmd ls|awk '{print $3}' | while read bucket; do #loop through buckets | ||
s3cmd del --recursive $bucket --force #delete bucket content | ||
s3cmd rb $bucket #remove actual bucket | ||
done | ||
rm $HOME/.s3cfg | ||
echo "Finished deleting files/buckets on $service." | ||
|
||
echo "Removing temporary service key." | ||
cf delete-service-key $service tempkey -f | ||
|
||
echo "You can now try to delete your s3 instance. This will only work if no remaining service keys/service shares exist." | ||
echo "Command: cf delete-service $service" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Backman app should be linked.