purge_EBS_Snapshots more portable - \t option does not work with grep (GNU grep) 2.10 from Ubuntu 12.04.1 LTS.

This commit is contained in:
Colin Johnson 2012-11-09 04:42:35 +00:00
parent fe3473a29b
commit e76a6743b4

View File

@ -98,7 +98,7 @@ purge_EBS_Snapshots()
for snapshot_id_evaluated in $snapshot_purge_allowed for snapshot_id_evaluated in $snapshot_purge_allowed
do do
#gets the "PurgeAfter" date which is in UTC with YYYY-MM-DD format (or %Y-%m-%d) #gets the "PurgeAfter" date which is in UTC with YYYY-MM-DD format (or %Y-%m-%d)
purge_after_date=`echo "$snapshot_tag_list" | grep .*$snapshot_id_evaluated'\t'PurgeAfter.* | cut -f 5` purge_after_date=`echo "$snapshot_tag_list" | grep .*$snapshot_id_evaluated'\s'PurgeAfter.* | cut -f 5`
#if purge_after_date is not set then we have a problem. Need to alter user. #if purge_after_date is not set then we have a problem. Need to alter user.
if [[ -z $purge_after_date ]] if [[ -z $purge_after_date ]]
#Alerts user to the fact that a Snapshot was found with PurgeAllow=true but with no PurgeAfter date. #Alerts user to the fact that a Snapshot was found with PurgeAllow=true but with no PurgeAfter date.