-
-
Save vanics/6ed7db351bfe3b1f4cdec5d4752c720e to your computer and use it in GitHub Desktop.
Revisions
-
caraboides revised this gist
Jan 22, 2017 . No changes.There are no files selected for viewing
-
caraboides renamed this gist
Jan 22, 2017 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ #!/bin/sh set -e HOST=localhost DB=test-entd-products -
caraboides renamed this gist
Jan 22, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
caraboides renamed this gist
Jan 22, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
caraboides created this gist
Jan 22, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,15 @@ set -e HOST=localhost DB=test-entd-products COL=asimproducts S3PATH="s3://mongodb-backups-test1-entd/$DB/$COL/" S3BACKUP=$S3PATH`date +"%Y%m%d_%H%M%S"`.dump.gz S3LATEST=$S3PATH"latest".dump.gz /usr/bin/aws s3 mb $S3PATH /usr/bin/mongodump -h $HOST -d $DB -c $COL -o - | gzip -9 | aws s3 cp - $S3BACKUP aws s3 cp $S3BACKUP $S3LATEST # Restore echo -n "Restore: " echo -n "aws s3 cp $S3LATEST - |gzip -d | mongorestore --host $HOST --db $DB -c $COL - "