From e76a6743b41bf17547b920f7eb23cfd5570c1b0e Mon Sep 17 00:00:00 2001 From: Colin Johnson Date: Fri, 9 Nov 2012 04:42:35 +0000 Subject: [PATCH] purge_EBS_Snapshots more portable - \t option does not work with grep (GNU grep) 2.10 from Ubuntu 12.04.1 LTS. --- ec2-automate-backup/ec2-automate-backup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ec2-automate-backup/ec2-automate-backup.sh b/ec2-automate-backup/ec2-automate-backup.sh index 2ebcb58..d45f2b5 100755 --- a/ec2-automate-backup/ec2-automate-backup.sh +++ b/ec2-automate-backup/ec2-automate-backup.sh @@ -98,7 +98,7 @@ purge_EBS_Snapshots() for snapshot_id_evaluated in $snapshot_purge_allowed do #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 [[ -z $purge_after_date ]] #Alerts user to the fact that a Snapshot was found with PurgeAllow=true but with no PurgeAfter date.