Created
January 20, 2012 15:34
-
-
Save oisin/1647905 to your computer and use it in GitHub Desktop.
Scripts to create/attach/snapshot multiple EBS volumes
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
(i=0; for vol in $(awk '{print $2}' vol_snaps.txt); do i=$((i+1)); ec2-attach-volume $vol -i i-aa3bc4c8 -d /dev/sdv${i}; done) |
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
(i=0; for vol in $(awk '{print $2}' vols.txt); do i=$((i+1)); ec2-attach-volume $vol -i i-11eee072 -d /dev/sdh${i}; done) |
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
for vol in $(awk '{print $2}' snapshots.txt); do ec2-create-volume --availability-zone us-east-1a --snapshot $vol; done > vol_snaps.txt |
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
(i=0; for vol in $(awk '{print $2}' backup_vols.txt); do i=$((i+1)); ec2-create-snapshot $vol --description "MongoDB RAID backup${i}"; done) |
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
for x in {1..4}; do ec2-create-volume -s 4 -z us-east-1a; done > vols.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment