# Find and Fetch

**URL:** <https://forum.ansible.com/t/find-and-fetch/28225>\
**Category:** Ansible Project\
**Created:** [August 1, 2018, 1:01pm UTC](https://forum.ansible.com/t/find-and-fetch/28225 "2018-08-01T13:01:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![onenessboy](https://avatars.discourse-cdn.com/v4/letter/o/90ced4/32.png) [@onenessboy](https://forum.ansible.com/u/onenessboy)\
**Post date:** [August 1, 2018, 1:01pm UTC](https://forum.ansible.com/t/find-and-fetch/28225/1 "2018-08-01T13:01:11Z")

</div>

Hi

I am using below code to find and fetch files from remote server to local, how ever its not erroring, but not fetch anything

- find:  
paths=“/home/cloud-user”  
patterns=“\*.tar”  
register: file\_to\_copy

- fetch:  
src={{ item.path }}  
dest=/home/cloud-user/abscp  
with\_items: “{{file\_to\_copy.files}}”

I have some files named abc.tar.gz, dba.tar.gz – what I am trying to find patter and copy all to local machine…

Can someone suggest what mistake i am doing here.

---

<div class="post-metadata">

**Author:** ![Lucio](https://avatars.discourse-cdn.com/v4/letter/l/ec9cab/32.png) [@Lucio](https://forum.ansible.com/u/Lucio)\
**Post date:** [August 1, 2018, 3:56pm UTC](https://forum.ansible.com/t/find-and-fetch/28225/2 "2018-08-01T15:56:41Z")

</div>

At first glance, your patterns seems to be missing a '.gz' after '.tar'. Do all files end in '.tar.gz'?

---

<div class="post-metadata">

**Author:** ![vinod93pop](https://avatars.discourse-cdn.com/v4/letter/v/ea5d25/32.png) [@vinod93pop](https://forum.ansible.com/u/vinod93pop)\
**Post date:** [August 3, 2018, 3:22am UTC](https://forum.ansible.com/t/find-and-fetch/28225/3 "2018-08-03T03:22:07Z")

</div>

Can you try like this in your pattern “_.tar_”
