read

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:

  1. The -r parameter sets the region of the snapshots/EBS volumes which is crucial
  2. The -k parameter sets the number of days that each snapshot can live, if you set this parameter, read the next point -
  3. 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.

Example command:

/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.

Blog Logo

Alvin Zhang

I started writing code in 1998 when I tried to make new in-game units for an amazing RTS game called Total annihilation. Today I run Red Airship and am on a quest to cook good paella.


Published

Image

1998 Nineteen-Ninety-Eight

Thoughts, stories and ideas.

Back to Overview