diff --git a/ec2-automate-backup/ec2-automate-backup.sh b/ec2-automate-backup/ec2-automate-backup.sh index e1211d3..3ef1e57 100755 --- a/ec2-automate-backup/ec2-automate-backup.sh +++ b/ec2-automate-backup/ec2-automate-backup.sh @@ -166,21 +166,20 @@ auto_tag=false #sets the Purge Snapshot feature to false - this feature will eventually allow the removal of snapshots that have a "PurgeAfter" tag that is earlier than current date purge_snapshots=false #handles options processing -while getopts :s:c:r:v:t:k:pna opt - do - case $opt in - s) selection_method="$OPTARG";; - c) cron_primer="$OPTARG";; - r) region="$OPTARG";; - v) volumeid="$OPTARG";; - t) tag="$OPTARG";; - k) purge_after_days="$OPTARG";; - n) name_tag_create=true;; - p) purge_snapshots=true;; - a) auto_tag=true;; - *) echo "Error with Options Input. Cause of failure is most likely that an unsupported parameter was passed or a parameter was passed without a corresponding option." 1>&2 ; exit 64;; - esac - done +while getopts :s:c:r:v:t:k:pna opt; do + case $opt in + s) selection_method="$OPTARG";; + c) cron_primer="$OPTARG";; + r) region="$OPTARG";; + v) volumeid="$OPTARG";; + t) tag="$OPTARG";; + k) purge_after_days="$OPTARG";; + n) name_tag_create=true;; + p) purge_snapshots=true;; + a) auto_tag=true;; + *) echo "Error with Options Input. Cause of failure is most likely that an unsupported parameter was passed or a parameter was passed without a corresponding option." 1>&2 ; exit 64;; + esac +done #sources "cron_primer" file for running under cron or other restricted environments - this file should contain the variables and environment configuration required for ec2-automate-backup to run correctly if [[ -n $cron_primer ]]