參考網路上的修改過
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
https://www.linuxtutorial.co.uk/automate-ebs-volume-backups-bash/
https://github.com/colinbjohnson/aws-missing-tools/tree/master/ec2-automate-backup
https://simplyopensource.blogspot.tw/2014/04/script-to-create-daily-ami-of-aws.html
https://simplyopensource.blogspot.tw/2016/02/script-to-delete-ami-with-attached.html
https://www.flynsarmy.com/2015/06/how-to-schedule-daily-rolling-ebs-snapshots/
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/t2-instances.html
CPUCreditUsage
(Only valid for T2 instances) The number of CPU credits consumed during the specified period.
consumed 消耗
CPUCreditBalance
(Only valid for T2 instances) The number of CPU credits that an instance has accumulated.
accumulated 累積
http://severalnines.com/blog/leveraging-aws-tools-speed-management-galera-cluster-amazon-cloud