Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - name: find all files that are older than three
- win_find:
- paths: C:\Websites\zzzBackup
- age: "2w"
- file_type: file
- register: dirsOlderThan12w
- - name: remove older than 12 weeks but first ten newest
- win_file:
- path: "{{ item.path }}"
- state: absent
- with_items: "{{ (dirsOlderThan12w.files | sort(attribute='ctime'))[10:] | list }}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement