# Ansible Template Module Backup - Manage Number of Backup Copies

**URL:** <https://forum.ansible.com/t/ansible-template-module-backup-manage-number-of-backup-copies/29460>\
**Category:** Ansible Developer\
**Created:** [January 17, 2019, 7:51pm UTC](https://forum.ansible.com/t/ansible-template-module-backup-manage-number-of-backup-copies/29460 "2019-01-17T19:51:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_LeBlanc](https://avatars.discourse-cdn.com/v4/letter/d/f08c70/32.png) [@Daniel\_LeBlanc](https://forum.ansible.com/u/Daniel_LeBlanc)\
**Post date:** [January 17, 2019, 7:51pm UTC](https://forum.ansible.com/t/ansible-template-module-backup-manage-number-of-backup-copies/29460/1 "2019-01-17T19:51:10Z")

</div>

Hello.

I am using the Ansible template module and create a backup file each change that is pushed. Over time these backup files become large in number as more and more changes are pushed out. In my case it only makes sense to maintain a small number of backup copies. Is it possible to configure / develop an upper limit on the number of backup files maintained? This would be much easier for users like me rather than building additional ansible tasks to clean up these old backup files.

Thanks!

---

<div class="post-metadata">

**Author:** ![Tchia04](https://avatars.discourse-cdn.com/v4/letter/t/fbc32d/32.png) [@Tchia04](https://forum.ansible.com/u/Tchia04)\
**Post date:** [February 14, 2019, 6:18am UTC](https://forum.ansible.com/t/ansible-template-module-backup-manage-number-of-backup-copies/29460/2 "2019-02-14T06:18:25Z")

</div>

I believe this task is best suited using a regular Unix cron job

Tony Chia .
