2014-03-02 18:47:30 +00:00
|
|
|
ec2ab_exec=/Temp/aws-missing-tools/ec2-automate-backup/ec2-automate-backup-awscli.sh
|
2012-09-21 02:04:51 +00:00
|
|
|
#create two volumes
|
|
|
|
volume_1=`ec2-create-volume --size 2 GB --availability-zone us-east-1a`
|
|
|
|
volume_2=`ec2-create-volume --size 2 GB --availability-zone us-east-1a`
|
|
|
|
#get volume id of both volumes
|
|
|
|
volume_1_id=`echo "$volume_1" | cut -f 2`
|
|
|
|
volume_2_id=`echo "$volume_2" | cut -f 2`
|
|
|
|
#tag volume_1 with Backup=true
|
|
|
|
ec2-create-tags $volume_1_id --tag Backup=true
|
|
|
|
#test backing up only volume with tag Backup=true
|
|
|
|
$ec2ab_exec -s tag -t Backup=true
|
2014-03-02 18:47:30 +00:00
|
|
|
# if testing ec2-automate-backup-awscli.sh
|
|
|
|
# $ec2ab_exec -s tag -t Backup,Values=true
|
2012-09-21 02:04:51 +00:00
|
|
|
#expected result - snapshot only taken of volume_1
|
|
|
|
#
|
|
|
|
#test backing up only EBS volume with IDs "x" and "y"
|
|
|
|
$ec2ab_exec -v "$volume_1_id $volume_2_id"
|
|
|
|
#expected result - snapshot only taken of volume_1 and volume_2
|
|
|
|
#
|
2014-03-02 05:58:42 +00:00
|
|
|
#test backing up only EBS volume with IDs "x" and "y" and tagging the snapshots with "name"
|
2012-09-21 02:04:51 +00:00
|
|
|
$ec2ab_exec -v "$volume_1_id $volume_2_id" -n
|
|
|
|
#expected result - snapshot only taken of volume_1 and volume_2 each with tag "name" set to ec2ab_$volume_id_$date_current
|
|
|
|
#
|
2014-03-02 05:58:42 +00:00
|
|
|
#test backing up only EBS volume with IDs "x" and "y" and tagging the snapshots with "user tags"
|
2013-02-17 23:31:59 +00:00
|
|
|
$ec2ab_exec -v "$volume_1_id $volume_2_id" -u
|
|
|
|
#expected result - snapshot only taken of volume_1 and volume_2 each with tag "user tags" set to Volume=$ebs_selected and Created=$current_date
|
|
|
|
#
|
2014-03-02 05:58:42 +00:00
|
|
|
#test backing up only EBS volume with IDs "x" and "y" and tagging the snapshots with a tag "PurgeAfter=14"
|
2012-09-21 02:04:51 +00:00
|
|
|
$ec2ab_exec -v "$volume_1_id $volume_2_id" -k 14
|
|
|
|
#expected result - snapshot only taken of volume_1 and volume_2 each with tags "PurgeAfter=$date_current+14" and "PurgeAllow=true"
|
|
|
|
#
|
2014-03-02 05:58:42 +00:00
|
|
|
#test backing up only EBS volume with IDs "x" and "y", tagging the snapshots with a tags "PurgeAfter=14" and name
|
2012-09-21 02:04:51 +00:00
|
|
|
$ec2ab_exec -v "$volume_1_id $volume_2_id" -k 14 -n
|
2012-09-24 23:34:15 +00:00
|
|
|
#expected result - snapshot only taken of volume_1 and volume_2 each with tag "name" set to ec2ab_$volume_id_$date_current
|
|
|
|
#
|