# unable to delete file from sub folders

**URL:** <https://forum.ansible.com/t/unable-to-delete-file-from-sub-folders/31793>\
**Category:** Ansible Project\
**Created:** [December 10, 2019, 7:11am UTC](https://forum.ansible.com/t/unable-to-delete-file-from-sub-folders/31793 "2019-12-10T07:11:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nasir\_Nasir](https://avatars.discourse-cdn.com/v4/letter/n/3e96dc/32.png) [@Nasir\_Nasir](https://forum.ansible.com/u/Nasir_Nasir)\
**Post date:** [December 10, 2019, 7:11am UTC](https://forum.ansible.com/t/unable-to-delete-file-from-sub-folders/31793/1 "2019-12-10T07:11:58Z")

</div>

Hi All,

I am using the below code for deleting file from folders, i am able to delete file from parent folder but its skipping files in sub folders:  
Please check and help me getting this fixed.

- name: Ansible delete files older than 1 minutes example  
find:  
paths: ‘{{diskclrpath}}’  
age: ‘{{fileage}}’  
patterns: ‘{{file\_ext}}’  
size: ‘{{file\_size}}’  
register: files\_to\_delete

- name: Ansible remove files older than a date example  
file:  
path: “{{ item.path }}”  
state: absent  
with\_items: “{{ files\_to\_delete.files }}”  
loop\_control:  
label: “{{ item.path }}”  
when: ((diskspc\_util \>= ‘{{diskuseper}}’) and ( ‘rwx’ in permissionchk))
