# Copy folder from one host to another

**URL:** <https://forum.ansible.com/t/copy-folder-from-one-host-to-another/36098>\
**Category:** Ansible Project\
**Created:** [December 10, 2021, 5:12am UTC](https://forum.ansible.com/t/copy-folder-from-one-host-to-another/36098 "2021-12-10T05:12:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lucas\_Possamai](https://avatars.discourse-cdn.com/v4/letter/l/5fc32e/32.png) [@Lucas\_Possamai](https://forum.ansible.com/u/Lucas_Possamai)\
**Post date:** [December 10, 2021, 5:12am UTC](https://forum.ansible.com/t/copy-folder-from-one-host-to-another/36098/1 "2021-12-10T05:12:23Z")

</div>

Hi all,

I need to copy the content of a folder from one remote host to another remote host. The copy command needs to be executed as user “postgres”.

Folder to be copied from source: /data/postgresql/pg\_xlog/  
Destination: /data/wal\_archive/

I tried looking online but couldn’t find anything useful. Can someone please point me in the right direction?

Cheers,  
Lucas

---

<div class="post-metadata">

**Author:** ![racke](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/racke/32/4767_2.png) [@racke](https://forum.ansible.com/u/racke)\
**Post date:** [December 10, 2021, 6:17am UTC](https://forum.ansible.com/t/copy-folder-from-one-host-to-another/36098/2 "2021-12-10T06:17:35Z")

</div>

> Hi all,
> 
> I need to copy the content of a folder from one remote host to another remote host. The copy command needs to be executed as user "postgres".
> 
> Folder to be copied from source: /data/postgresql/pg\_xlog/  
> Destination: /data/wal\_archive/
> 
> I tried looking online but couldn't find anything useful. Can someone please point me in the right direction?
> 
> Cheers,  
> Lucas

Hello Lucas,

take a look at the synchronize module.

Regards  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Racke
