I have an EC2
instance and I have the following bash
script which I need to run;
- Every 1 minute
- The same script every 12 hours
TOKEN=$(aws ecr get-login-password --region us-east-2)
# echo $TOKEN
CONVERT_ME="AWS:${TOKEN}"
BASE_64_ENCODED=$(echo -n "${CONVERT_ME}" | base64)
echo $BASE_64_ENCODED
jq -n --arg TOKEN $TOKEN '{"HttpHeaders": {"User-Agent": "Docker-Client/19.03.13-ce (linux)"},"auths": {"337198119645.dkr.ecr.us-east-2.amazonaws.com": {"auth": $TOKEN}}}' > ~/.docker/config.json
If I do something like below, it says command not found
* * * * * update.sh
So I tried crontab -e
and put the above command, how can I make sure if it is executing? is there a timer we can track? or am I doing this all wrong?
Thank you
question from:
https://stackoverflow.com/questions/65860789/how-to-write-a-cronjob-in-amazon-linux 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…