<p>I have an EKS cluster and an RDS (mariadb). I am trying to make a backup of given databases though a script in a <code>CronJob</code>. The <code>CronJob</code> object looks like this:</p>
<pre><code>apiVersion: batch/v1
kind: CronJob
metadata:
  name: mysqldump
  namespace: mysqldump
spec:
  schedule: &quot;* * * * *&quot;
  concurrencyPolicy: Replace
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: mysql-backup
            image: viejo/debian-mysqldump:latest
            envFrom:
            - configMapRef:
                name: mysqldump-config
            args:
            - /bin/bash
            - -c
            - /root/mysqldump.sh &quot;(${MYSQLDUMP_DATABASES})&quot; &gt; /proc/1/fd/1 2&gt;/proc/1/fd/2 || echo KO &gt; /tmp/healthcheck
            resources:
              limits:
                cpu: &quot;0.5&quot;
                memory: &quot;0.5Gi&quot;
          restartPolicy: OnFailure
</code></pre>
<p>The script is called <code>mysqldump.sh</code>, which gets all necessary details from a <code>ConfigMap</code> object. It makes the dump of the databases in an environment variable <code>MYSQLDUMP_DATABASES</code>, and moves it to S3 bucket.</p>
<p><em>Note: I am going to move some variables to a <code>Secret</code>, but before I need this to work.</em></p>
<p>What happens is NOTHING. The script is never getting executed I tried putting a &quot;echo starting the backup&quot;, before the script, and &quot;echo backup ended&quot; after it, but I don't see none of them. If I'd access the container and execute the same exact command manually, it works:</p>
<pre><code>root@mysqldump-27550908-sjwfm:/# /root/mysqldump.sh &quot;(${MYSQLDUMP_DATABASES})&quot; &gt; /proc/1/fd/1 2&gt;/proc/1/fd/2 || echo KO &gt; /tmp/healthcheck
root@mysqldump-27550908-sjwfm:/#
</code></pre>
<p><a href="https://i.stack.imgur.com/hJetE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hJetE.png" alt="enter image description here" /></a></p>
<p>Can anyone point out a possible issue?</p>

suren
<p>Try change <code>args</code> to <code>command</code>:</p>
<pre><code>...
command:
- /bin/bash
- -c
- /root/mysqldump.sh &quot;(${MYSQLDUMP_DATABASES})&quot; &gt; /proc/1/fd/1 2&gt;/proc/1/fd/2 || echo KO &gt; /tmp/healthcheck
...
</code></pre>
