From 8c43708518deb2b7853b796eca5fed9d25d0425c Mon Sep 17 00:00:00 2001 From: Colin Johnson Date: Mon, 21 Apr 2014 01:37:59 +0000 Subject: [PATCH] add comments regarding support for CentOS 5 --- ec2-automate-backup/ec2-automate-backup.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ec2-automate-backup/ec2-automate-backup.sh b/ec2-automate-backup/ec2-automate-backup.sh index 3128ef0..d46245c 100755 --- a/ec2-automate-backup/ec2-automate-backup.sh +++ b/ec2-automate-backup/ec2-automate-backup.sh @@ -120,6 +120,10 @@ purge_EBS_Snapshots() { for snapshot_id_evaluated in $snapshot_purge_allowed; do #gets the "PurgeAfterFE" date which is in UTC with UNIX Time format (or xxxxxxxxxx / %s) + # if running under CentOS 5 - note the use of "grep -P" in the comment below + # use of grep -P is not used because it breaks compatibility with OS X + # Mavericks + # snapshot_purge_allowed=$(echo "$snapshot_tag_list" | grep -P "^.*PurgeAllow\strue$" | cut -f 3) purge_after_fe=$(echo "$snapshot_tag_list" | grep .*$snapshot_id_evaluated'\s'PurgeAfterFE.* | cut -f 5) #if purge_after_date is not set then we have a problem. Need to alert user. if [[ -z $purge_after_fe ]]; then