<p>After reading a lot of manuals, I still don't understand if it is possible to save a file to the host after performing a job or a cronjob.</p>
<p>My Job got PVC and PV like that:</p>
<pre><code>volumes:
  - name:  name1
    persistentVolumeClaim:
      claimName: name2
</code></pre>
<p>and:</p>
<pre><code>volumeMounts:
  - name: save-file
    mountPath: /mnt/dir
</code></pre>
<p>Let's say I'm running a script that saves the output to a file:</p>
<pre><code>command: [&quot;dosomething.py&quot;]
args: [&quot; --save-to-file output.txt&quot;]
</code></pre>
<p>Is there some way to save it to the host or send it somewhere?</p>

cryptoparty
<p>Mount the volume for container and give a mount path-</p>
<pre><code>  volumeMounts:
    - name: &quot;name1&quot;
      mountPath: &quot;/var/www/html&quot;
</code></pre>
<p>The container can save file to it.
Read more details here - <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/#create-a-persistentvolume" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/#create-a-persistentvolume</a></p>
