Posts

Showing posts from January, 2017

Auto AMI Backup of Ec2 instance

#!/bin/bash #Script Details #Script to create AMI of server on (based on cron timeperiod) and deleting AMI older than 3 days. #Time period can be controlled by the cron like Daily AMI Creation, every 3 days or weekly AMI Creation #The Retaining time for the AMI is 3days by default , however this can be customized on your requirement. #Deletion on AMI removes the associated snapshots #You need to pass the instance ID along as the arguments to the script #Credentials are fetched from the config file of the user #Uses the Sns configuration for sending the AMI Status #Instance Name is determined from the tag Name assigned to the instance #If Name tag is not found than script would exist with error message mail. #AMI Backup name would be having Instancename following by date in the YYYYMMDD format. #The backed up AMI would be having additional tags to identify the necessary information as follows #The instance ID from which this AutoAMI was creat...