Created
September 25, 2014 15:26
-
-
Save finger-berlin/307f45cafb71010ab6c8 to your computer and use it in GitHub Desktop.
AWS EC2 automated backup into AMIs
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
for h in $(ec2-describe-instances --filter instance-state-name=running | grep -iv stack | grep -iv autoscaling | grep Name | cut -f3,5 | tr "\t" ":" ); | |
do echo $h; | |
INSTANCE=$(echo $h|cut -d: -f1); | |
INAME=$(echo $h|cut -d: -f2); | |
ec2-create-image $INSTANCE --name $INAME.$(date +%Y%m%d) --description $INAME.$(date +%Y%m%d) --no-reboot; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment