<p>I have a docker container, in which I'm running the following cron job:</p>
<pre class="lang-sh prettyprint-override"><code>SHELL=/bin/bash
BASH_ENV=/container.env
*/1 * * * * find ${CLONE_DIR} -mmin +10 -exec rm -fr {} &gt;&gt; /var/log/cronjob.log 2&gt;&amp;1 \;
</code></pre>
<p>The cronjob works perfectly in my local environment (i.e using docker-compose to launch the container).</p>
<p>In my production environment I use k8s and remove all capabilities from the container:</p>
<pre class="lang-yaml prettyprint-override"><code>securityContext:
  capabilities:
    drop:
    - ALL
</code></pre>
<p>Which results in the job not running at all.</p>
<p>Checklist:</p>
<ul>
<li>I verified that <code>cron</code> service is running.</li>
<li>No errors in the <code>cron</code> script.</li>
<li><code>crontab -l</code> lists the job</li>
</ul>
<p>I've tested the container with and without <code>capabilities</code> and can verify that with it it works, and without it doesn't. Therefore, I think this is the problem.</p>
<p>What capability should I add to my container in order for this to work?
Thanks for your help and attention.</p>

Saar Kuriel
<p>The missing capability was: <code>CAP_SETGID</code></p>
