<p>I've pod with two containers, one is creating a file and one delete it, I was able to create the file but not to delete it. I want it to delete the files every 2 hours, how can I make it work in clean way? we dont want to use cron job...</p>
<pre><code>apiVersion: v1
    kind: Pod
    metadata:
      name: its
    spec:
      volumes:
      - name: common
        emptyDir: {}
      containers:
      - name: 1st
        image: nginx
        volumeMounts:
        - name: common
          mountPath: /usr/share/nginx/html
      - name: 2nd
        image: debian
        volumeMounts:
        - name: common
          mountPath: /html
        command: [&quot;/bin/sh&quot;, &quot;-c&quot;]
        args:
          - while true; do
              date &gt;&gt; /html/index.html;
              sleep 7200;
            done
</code></pre>

<p>This is what works for me</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: mc1
spec:
  volumes:
  - name: html
    emptyDir: {}
  containers:
  - name: 1st
    image: nginx
    command: [&quot;/bin/sh&quot;, &quot;-c&quot;]
    args:
      - while true; do
          touch /usr/share/nginx/html/test.txt;
          ls /usr/share/nginx/html/;
          echo &quot;file created cotnainer 1&quot;;
          sleep infinity;
        done
    volumeMounts:
    - name: html
      mountPath: /usr/share/nginx/html
  - name: 2nd
    image: debian
    volumeMounts:
    - name: html
      mountPath: /html
    command: [&quot;/bin/sh&quot;, &quot;-c&quot;]
    args:
      - while true; do
          ls /html;
          rm /html/test.txt;
          echo &quot;container 2 - file removed&quot;;
          ls /html;
          sleep 7200;
        done
</code></pre>
<p>i am creating a file from <code>container 1</code> and getting removed by <code>container 2</code>  what error are you getting?</p>
