diff --git a/ec2-automate-backup/ec2-automate-backup.sh b/ec2-automate-backup/ec2-automate-backup.sh index 3ef1e57..056e33e 100755 --- a/ec2-automate-backup/ec2-automate-backup.sh +++ b/ec2-automate-backup/ec2-automate-backup.sh @@ -150,11 +150,6 @@ app_name=`basename $0` #sets defaults selection_method="volumeid" -if [ -z $EC2_REGION ]; - then region="us-east-1" -else - region="$EC2_REGION" -fi #date_binary allows a user to set the "date" binary that is installed on their system and, therefore, the options that will be given to the date binary to perform date calculations date_binary="" @@ -190,6 +185,14 @@ if [[ -n $cron_primer ]] fi fi +if [ -z $region ]; then + if [ -z $EC2_REGION ]; then + region="us-east-1" + else + region="$EC2_REGION" + fi +fi + #calls prerequisitecheck function to ensure that all executables required for script execution are available prerequisite_check