Created
September 16, 2020 12:29
-
-
Save gustavoapolinario/4149a615beb7f768623bea5070ecc730 to your computer and use it in GitHub Desktop.
Cancel All AWS Batchs Jobs to run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
for i in $(aws --profile [PROFILE] --region [REGION] batch list-jobs --job-queue [QUEUE] --job-status runnable --output text --max-items 10000 --query jobSummaryList[*].[jobId]) | |
do | |
echo "Cancel Job: $i" | |
aws --profile [PROFILE] --region [REGION] batch cancel-job --job-id $i --reason "Cancelling job." | |
#echo "Job $i canceled" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment