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?

feita há 5 anos289 visualizações
1 Resposta
0

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

respondido há 5 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas