2

I am looking to see if there is a way of running a task on a repeat interval with an explicit start and end date.

In the ecosystem I have found that Cron Job task type lines up very well with a repeat task. However I've been having trouble finding a Cron Job scheduler that has a start and end date.

Most only allow a cron expression to provided to tune when a task is run. So far the only way I've found to enforce a start and end date is to make the logic of the task itself either exit early if before the start date or delete the job after the end date.

I was wondering if there were any schedulers that implemented start and end date behavior for recurring tasks.

(So far I've found the Kubernetes CronJob and Argo CronJob)

recoup8063
  • 121
  • 3

1 Answers1

0
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: my-cronjob
spec:
  schedule: "*/15 * * * *"
  startTime: 2023-03-07T10:00:00Z
  jobTemplate:
    spec:
      activeDeadlineSeconds: 1800 #end time specification
      template:
        spec:
          containers:
          - name: my-container
            image: my-image
            command: ["/bin/sh"]
            args: ["-c", "echo Hello, World!"]
JoSSte
  • 133
  • 1
  • 10