AWS cron expression to run a job every 2 days once

0 votes

I need to plan a task in AWS CloudWatch events so that it runs once every two days. I'm trying to use the expression below, but I keep receiving the message that ScheduleExpression is not acceptable.

cron(0 0 */2 * ? *)

Java code is attached below:

String cronExpression = "cron(0 0 */2 * ? *)"
    PutRuleRequest request = new PutRuleRequest();
        request
            .withName(eventName)
            .withRoleArn("arn:aws:iam::****")
            .withScheduleExpression(cronExpression)
            .withState(RuleState.ENABLED);
        PutRuleResult result = cloudwatchConfig.cloudwatch().putRule(request);
Jan 20, 2023 in AWS by Lakhbir
• 100 points

edited 4 days ago 8 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP