<p>I want to run one cron at different times.</p>
<p>Is it possible to do something like this in my YML file:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: my-cronjob
spec:
  schedule: 
    - &quot;*/10 00-08 * * *&quot;
    - &quot;*/5 09-18 * * *&quot;
    - &quot;*/10 19-23 * * *&quot;
  concurrencyPolicy: Forbid
...
</code></pre>
<p>or do I have to create separate YML files for every schedule time?</p>

Tomas Lukac
<p>The short answer is: no, you cannot create one <code>CronJob</code> YML with several crontab times schedules.</p>
<p>The easy solution would be to use separate <a href="https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/" rel="noreferrer">CronJob</a> resource for each crontab line from your example. You can use the same image for each of your <code>CronJobs</code>.</p>
