[cs615asa] hw5 Question

Justin Barish jbarish at stevens.edu
Fri Apr 5 11:22:51 EDT 2019


In the assignment spec, it mentions that the user can do the following:
export EC2_BACKUP_FLAGS_SSH="-i ~/.ssh/ec2-key"

However, from trying this, I cannot get this to work, in that sh will not
expand the tilde, so I get:
Identity file ~/.ssh/ec2-key not accessible: No such file or directory
(despite the key being there)

If I change it to be
export EC2_BACKUP_FLAGS_SSH="-i /root/.ssh/ec2-key"
It works fine.

I thought it maybe had to do with having quotes around the variable name
(I.E. ssh "$EC2_BACKUP_FLAGS_SSH" ...), but getting rid of the quotes did
not fix the issue.

Is there any special way to use the EC2_BACKUP_FLAGS_SSH so that the tilde
expansion
 happens, or would this just be considered bad input on the user's end?

-Justin


On Wed, Apr 3, 2019 at 11:42 PM Jan Schaumann <jschauma at stevens.edu> wrote:
>
> Justin Barish <jbarish at stevens.edu> wrote:
>
> > Since we should check the return code of all functions for failure, how
> > should this be handled, since the above causes a return code of 1, as
does
> > other possible failures? Would a correct answer be to just ignore the
> > return value of du, and do checks (such as the existence of the
directory)
> > separately?
>
> Consider what the user would want and most likely expect.  If I'm trying
> to backup a directory, but don't have permissions to access some
> subdirectories deep within the hierarchy, would I want:
>
> - the backup to abort, saying that it can't read all the files?
>
> - the backup to continue as best as it can, but let me know that some
>   directories could not be backed up?
>
> - to silently ignore the error and thus give me the impression that all
>   data was backed up?
>
> I think the third option is not acceptable, but for the first two an
> argument can be made either way.  Your choice here then dictates how you
> want to handle the other special cases, although I suspect some initial
> sanity checking on the arguments given prior to invoking du(1) would
> likely make sense.
>
> > Also, should we have du count filesystem mount points, or ignore them
(-x
> > flag)?
>
> By convention, Unix tools require a flag to be instructed not to cross
> mountpoints, so the default is to be mount point agnostic.  Your tool
> should follow that convention.  (A future iteration could conceivably
> add an option to not traverse mount points, but we don't need that here,
> I think.)
>
> -Jan
> _______________________________________________
> cs615asa mailing list
> cs615asa at lists.stevens.edu
> https://lists.stevens.edu/mailman/listinfo/cs615asa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.stevens.edu/pipermail/cs615asa/attachments/20190405/2722b5c6/attachment.html>


More information about the cs615asa mailing list