<p>According the documentation you're giving, you need to remove <code>run-build</code> from the command :</p>
<pre><code>$ oc run NAME --image=&lt;image&gt; \
    [--generator=&lt;resource&gt;] \
    [--port=&lt;port&gt;] \
    [--replicas=&lt;replicas&gt;] \
    [--dry-run=&lt;bool&gt;] \
    [--overrides=&lt;inline_json&gt;] \
    [options]
</code></pre>

CC BY-SA 4.0
2021-04-20T17:50:55.780Z
2021-04-20T17:50:55.780Z
Paul Rey
<p>The doc <a href="https://docs.openshift.com/container-platform/3.9/dev_guide/cron_jobs.html" rel="nofollow noreferrer">https://docs.openshift.com/container-platform/3.9/dev_guide/cron_jobs.html</a> provides details of creating a cron job.</p>
<p>To start a scheduled task that executes a build every 10 mins I use the command:</p>
<pre><code>oc run run-build 161/my-app --image=myimage --restart=OnFailure --schedule='*/10 * * * *' 
</code></pre>
<p>Which returns:</p>
<pre><code>cronjob.batch/run-build created
</code></pre>
<p>But the job fails to start:</p>
<p>The log of pod displays:</p>
<pre><code>Error: unknown command &quot;161/my-app&quot; for &quot;openshift-deploy&quot;
Run 'openshift-deploy --help' for usage.
</code></pre>
<p>Have I configured the command ( <code>oc run run-build 161/my-app --image=myimage --restart=OnFailure --schedule='*/10 * * * *'</code> ) to start the cron job incorrectly ?</p>

CC BY-SA 4.0
2021-04-19T15:09:45.303Z
What is the `command` that your job needs to run?
Eduardo Baitello
<kubernetes><openshift><kubectl>
Scheduling a build using Kubernetes
blue-sky
# Scheduling a build using Kubernetes

(Asked by: username_0 on 2021-04-16)

The doc https://docs.openshift.com/container-platform/3.9/dev_guide/cron_jobs.html provides details of creating a cron job.
To start a scheduled task that executes a build every 10 mins I use the command:
oc run run-build 161/my-app --image=myimage --restart=OnFailure --schedule='*/10 * * * *' 

Which returns:
cronjob.batch/run-build created

But the job fails to start:
The log of pod displays:
Error: unknown command "161/my-app" for "openshift-deploy"
Run 'openshift-deploy --help' for usage.

Have I configured the command ( oc run run-build 161/my-app --image=myimage --restart=OnFailure --schedule='*/10 * * * *' ) to start the cron job incorrectly ?

**Tags:** kubernetes, openshift, kubectl

> **Comments:**
> **username_1**: What is the `command` that your job needs to run?  

---

## 1 answers

### Answer by username_2 on 2021-04-20. Score: 1

According the documentation you're giving, you need to remove run-build from the command :
$ oc run NAME --image= \
    [--generator=] \
    [--port=] \
    [--replicas=] \
    [--dry-run=] \
    [--overrides=] \
    [options]


---

