aws ami snapshot 備份
參考網路上的修改過 https://simplyopensource.blogspot.tw/2014/04/script-to-create-daily-ami-of-aws.html https://github.com/colinbjohnson/aws-missing-tools/blob/master/ec2-automate-backup/ec2-automate-backup.sh 使用指令 amibackup.sh -i i-0102e3b13418794d4 -r ap-northeast-2 -d 1 » /root/ami_backup/AmiBackupLog.log 2>&1 #!/bin/bash # ReadMe - How to use this script # cyfbackup.sh -r [region] -i [instance name] # -d [How may days ago to delete] -t [emulate today is how many days ago] #Define TextColor Varible to use #TextRedBgYellow="\e[0;31;43m" TextGreen="\e[0;32m" TextRed="\e[0;31m" TextYellow="\e[0;33m" TextBlue="\e[0;36m" EndText="\e[0m" #Define test_day for Emulate Today is some days ago. declare -i test_day=0 #get Paramenter -d beforeDay2Del, -i InstanceID, -r Region while getopts :d:i:r:t:end opt; do case $opt in d) remainDay=$OPTARG;; i) instance_id=$OPTARG;; r) region=$OPTARG;; t) test_day=$OPTARG;; *) echo “Option is invalid, Please check.”; exit 1;; esac done ...