aws s3 cp in userdata and existence of files

0

Hi I can not figure this completely out.

To me it looks like that aws s3 cp from bucket to local fs finishes the command early, causing issues in my script, I already tried sleep but that doesn't really work (probably not enough time allocated).

Script:

aws s3 cp --no-progress s3://dr-mc-server/fam-dw20/fam-dw20-server.zip /home/ec2-user/minecraft/fam-dw20-server.zip
sleep 15
chmod +r /home/ec2-user/minecraft/fam-dw-20-server.zip
mkdir /home/ec2-user/minecraft/Direwolf20
chown -R ec2-user:ec2-user /home/ec2-user/minecraft
unzip /home/ec2-user/minecraft/fam-dw-20-server.zip -d /home/ec2-user/minecraft/Direwolf20

log:

download: s3://dr-mc-server/fam-dw20/fam-dw20-server.zip to ./fam-dw20-server.zip
chmod: cannot access '/home/ec2-user/minecraft/fam-dw-20-server.zip': No such file or directory
unzip:  cannot find or open /home/ec2-user/minecraft/fam-dw-20-server.zip, /home/ec2-user/minecraft/fam-dw-20-server.zip.zip or /home/ec2-user/minecraft/fam-dw-20-server.zip.ZIP.

Any idea?

asked 5 years ago279 views
1 Answer
0

typo in the unzip command, now to figure out to make sure that an ebs volume is really attached.

answered 5 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions