<p>I have next kubernetes cronjob specification:</p>
<pre class="lang-yaml prettyprint-override"><code>          containers:
          - args:
            - -c
            - |
              export NLS_LANG=AMERICAN_AMERICA.UTF8 ;
              echo &quot;Exporting addresses&quot; ;
              sqlplus bta/$ORACLE_PASSWORD@//10.203.0.34/bta @adm_address_export.sql &gt; /dev/null ;
              if [[ ! -f address.tsv ]]; echo 'File &quot;address.tsv&quot; is not there, aborting.'; echo $? ; then exit 0; fi ;
              echo &quot;Ready to import addresses&quot; ;
</code></pre>
<p>I want this job to fail if address.tsv is not created by command before. But for some reason it fails also if file exist.</p>
<p>What I am doing wrong here?</p>

GintsGints
<p>The if statement is incorrect in that then needs to follow if [[ ... ]] and so:</p>
<pre><code>if [[ ! -f address.tsv ]]; then echo 'File &quot;address.tsv&quot; is not there, aborting.'; echo $? ; exit 0; fi
</code></pre>
