[cs615asa] [CS615] HW2

Devesh Jain djain5 at stevens.edu
Wed Apr 3 21:16:17 EDT 2019


Does this mean we should only consider using a standard magnetic disk and not gp2?

-----Original Message-----
From: Jan Schaumann <jschauma at stevens.edu> 
Sent: Sunday, March 10, 2019 23:44
To: Devesh Jain <djain5 at stevens.edu>
Subject: Re: [CS615] HW2

Devesh Jain <djain5 at stevens.edu> wrote:
 
> Apologies for the previous mail. Please find attached the file.

Your grade for HW2 is: 16/20

No details etc. in the README despite my previous comment asking for more.

Script is missing the '#!' shebang.  As a result, it will use /bin/sh, but your code is bash-specific, so will fail to run on a system where /bin/sh is not bash.  As a result, "./ec2-backup" will fail unless invoked explicitly as "bash ec2-backup".

> iid=$(aws ec2 run-instances --image-id ami-569ed93c


This is hard-coding a single AMI for any and all
volumes.  This won't work if the volume is not in the
same region as this AMI.

You're missing any and all error checking.  What if
any of the AWS commands is unsuccessful?

> if [ "$volume" ]
> then
>   echo "Volume attached"
> else
>   echo "Status: 3 -Some error

Your script must not produce any output other than
what's required, so "Volume attached" is undesirable.

Error messages should be specific.  "Some error" is
not.

> ssh -i ec2-backup -o StrictHostKeyChecking=no root@$ip_address << 'ENDSSH'

Specifying '-i' should not be required.  In fact, it
may be wrong: the keypair named 'ec2-backup' in my EC2
account may be stored as something different
altogether on my file system.  Per instructions, rely
on ~/.ssh/config to be set up correctly as shown on
the mailing list.

> fdisk

This does not print the disklabel; it shows the BIOS
partition table.  Revisit the difference from lectures
2 and 3.

> echo "0" #status 0 for all other cases

We do not want any output like this.

- missing terminaton of instance once we're done


More information about the cs615asa mailing list