I am not used to write bash script but trying to do below. and searched a lot in google but could not find much help. from my aws command i am already getting atleast 5 timestamp. I am trying to compare system timestamp with the AWS timestamp and if the AWS timestamp is 5 days or more old i would like to echo 'true'. below is what i am trying to do.
timeofsnap=$(aws ec2 describe-snapshots --region us-west-2 --snapshot-id ${myarray[i]} --query 'Snapshots[*].{Time:StartTime}' --output text)
DEBUG "West SnapID timestamp = "$timeofsnap
if $timeofsnap -mtime +30
do echo 'true'
else
do nothing
i=$[$i+1]
Aucun commentaire:
Enregistrer un commentaire