# TASK \[archive the files\] fatal: : FAILED! =\> {"msg": "'dict object' has no attribute 'files'"}

**URL:** <https://forum.ansible.com/t/task-archive-the-files-fatal-failed-msg-dict-object-has-no-attribute-files/34478>\
**Category:** Ansible Project\
**Created:** [January 20, 2021, 3:31pm UTC](https://forum.ansible.com/t/task-archive-the-files-fatal-failed-msg-dict-object-has-no-attribute-files/34478 "2021-01-20T15:31:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nithin\_Subbaraj](https://avatars.discourse-cdn.com/v4/letter/n/e480ec/32.png) [@Nithin\_Subbaraj](https://forum.ansible.com/u/Nithin_Subbaraj)\
**Post date:** [January 20, 2021, 3:31pm UTC](https://forum.ansible.com/t/task-archive-the-files-fatal-failed-msg-dict-object-has-no-attribute-files/34478/1 "2021-01-20T15:31:28Z")

</div>

Hi Team,

I am trying to create an ansible script which excludes a particular directory and its contents  
and should zip the files under other directories but getting the below error

TASK [archive the files] fatal: : FAILED! =\> {“msg”: “‘dict object’ has no attribute ‘files’”}

my script

---

<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:** [January 20, 2021, 3:46pm UTC](https://forum.ansible.com/t/task-archive-the-files-fatal-failed-msg-dict-object-has-no-attribute-files/34478/2 "2021-01-20T15:46:13Z")

</div>

> Hi Team,
> 
> I am trying to create an ansible script which excludes a particular directory and its contents  
> and should zip the files under other directories but getting the below error
> 
> TASK [archive the files] fatal: : FAILED! =\> {"msg": "'dict object' has no attribute 'files'"}

Only the find module would add "files" to the registered value- The command module  
doesn't do that.

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

---

<div class="post-metadata">

**Author:** ![Nithin\_Subbaraj](https://avatars.discourse-cdn.com/v4/letter/n/e480ec/32.png) [@Nithin\_Subbaraj](https://forum.ansible.com/u/Nithin_Subbaraj)\
**Post date:** [January 20, 2021, 4:11pm UTC](https://forum.ansible.com/t/task-archive-the-files-fatal-failed-msg-dict-object-has-no-attribute-files/34478/3 "2021-01-20T16:11:21Z")

</div>

Thanks for the help ,our main aim is to create a automated ansible script  
which takes multiple path (hard coded) and with find module it should check files older  
than 7 days and should exclude few directories or files and should compress the other files.

But somehow find and exclude path with time stamp is not working

I am trying multiple approaches but not successful but no luck ,any hint would be helpful

Ref:  
[https://groups.google.com/g/ansible-project/c/xEQVAxWnO-Y](https://groups.google.com/g/ansible-project/c/xEQVAxWnO-Y)  
[https://groups.google.com/g/ansible-project/c/63vMBMJnsqQ](https://groups.google.com/g/ansible-project/c/63vMBMJnsqQ)
