When using ec2-automate-backup.sh available at https://github.com/colinbjohnson/aws-missing-tools/tree/master/ec2-automate-backup, it is useful to note the following:
- The -r parameter sets the region of the snapshots/EBS volumes which is crucial
- The -k parameter sets the number of days that each snapshot can live, if you set this parameter, read the next point -
- If you set the -k parameter above, remember to set the -p paramter to 1. Which will actually tell the script to do the actual purging of snapshots. Without this, the script will simply tag each snapshot created with 2 tags that indicates the life of the snapshot.
/usr/local/bin/ec2-automate-backup.sh -v vol-xxxxxxxx -r ap-southeast-1 -k 7 -p 1
This will automate a backup in the southeast asia region of the volume specified. The snapshots will live for 7 days and will be purged by the script.