简体   繁体   中英

AWS Glue Schedule a Job with Cli

I would like to ask how can I schedule a AWS Glue job from AWS cli or boto3.

I couldn't find it in the official documentation either boto3 documentation

在此处输入图像描述

I know there is another way that includes creating a Trigger linked to the job, but not I'm not sure which it's the recommended one.

Thank you in advance.

Best (subjective) and the only way I'm aware of and that's documented by AWS is to do it by creating a JSON file first, for example:

{
  "Name": "your_schedule",
  "Description": "AWS GLUE docs suck",
  "Schedule": "cron(0 12 * * ? *)",
  "Actions": [
    {
      "JobName": "test_job"
    }
  ]
}

and then supply it as an argument to the aws glue , like this:

aws glue create-trigger --type SCHEDULED --cli-input-json file://your_job_schedule.json

If you got all the bits right, the output should be like this:

{
    "Name": "your_schedule"
}

Full syntax for the JSON file is here .

The docs you need are:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM