<p>I have a use case in which I need to run <code>kubectl</code> command in <code>crontab</code>. I am getting empty response from all <code>kubectl</code> commands</p>
<p>I have tried this</p>
<pre><code>#!/bin/sh

/usr/bin/kubectl get po &gt;&gt; /cron.txt
</code></pre>
<p>Help will be appreciated!</p>

Ali Mehdi
<p>I don't know why you're not getting any output, but I think I know why it's not telling you why it's not getting output.</p>
<p>Your command line is only going to get stdout, and drop stderr on the floor. It's likely that stderr will tell you why it's not working.</p>
<p>Try changing the command line to:</p>
<pre><code>/usr/bin/kubectl get po 2&gt;&amp;1 &gt;&gt; /cron.txt
</code></pre>
