Created
January 4, 2012 06:59
-
-
Save naoty/1558878 to your computer and use it in GitHub Desktop.
create EBS snapshot
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 characters
#!/bin/sh | |
volume="$1" | |
snapshot=`ec2-create-snapshot $volume | cut -f 2` | |
status="pending" | |
while [ "$status" = "pending" ]; do | |
sleep 300 | |
status=`ec2-describe-snapshots $snapshot | cut -f 4` | |
done | |
if [ "$status" = "error" ]; then | |
echo "failed to create snapshot" | |
else | |
echo "completed to create snapshot" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment