# How to Copy Files From Pod to Host.

## Problem

**Sample scenario**: While modifying the configMap \[argocd-cm] inside Sunpike-server pod. The recommended option is to take a backup of the comfigmap in yaml file format. Since, these files are residing inside pod, once the pod crashes the files will be lost in case of ephemeral volumes. To avoid this, we need copy the files from the pod to the host server.

## Environment

* Platform9 Managed Kubernetes - v-5.4. and Higher

## Procedure

From the Master node terminal execute below command, using which we can copy any file from pod to current master node:

{% tabs %}
{% tab title="Javascript" %}

```javascript
kubectl cp <some-namespace>/<some-pod>:/tmp/foo_in_pod   /tmp/bar_in_master_node
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://platform9.com/kb/pmk/how-to/how-to-copy-files-from-pod-to-host.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
