Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
apt-get update -qcloudformationテンプレートのユーザーデータスクリプトで、などのコマンドがランダムに失敗することがあります。それらが成功するまでそれらを再試行する適切な方法は何ですか?
apt-get update -q
@shellterが指摘したように:
while ! apt-get update -q ; do sleep 1; done
または、スクリプトの場合:
while ! apt-get update -q do echo "Failed. Trying again..." >&2 sleep 1 done