Skip to content

Instantly share code, notes, and snippets.

@tlienart
Last active August 27, 2020 11:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tlienart/0e88915ea781d0552a26bdc4bfa84541 to your computer and use it in GitHub Desktop.
Save tlienart/0e88915ea781d0552a26bdc4bfa84541 to your computer and use it in GitHub Desktop.
AWS cli useful commands

SM

  • (check) kill training job (throttled)
aws s3 stop-training-job --training-job-name $TRAINING_JOB_NAME

Can do that in for loop, can also check the status before killing

for d in d1 d2 d3
do
aws sagemaker stop-training-job --training-job-name $d
done

checking status:

aws sagemaker describe-training-job --training-job-name $TRAINING_JOB_NAME

S3

aws s3 cp $LOCAL_PATH s3://$BUCKET_PATH
aws s3 cp s3://$BUCKET_PATH $LOCAL_PATH
  • list content of bucket
aws s3 ls s3://$BUCKET
  • Get the size of a bucket (in MiB or GiB)
aws s3 ls s3://$BUCKET_PATH --recursive --human-readable --summarize | grep "Total Size"
  • Remove a file in a bucket
aws s3 rm s3://$BUCKET_PATH/file/path
  • Copy a folder being mindful of what may already have been copied and giving full access
aws s3 sync s3://$SOURCE_PATH s3://$TARGET_PATH --acl bucket-owner-full-control
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment