# template backups in conf.d style locations

**URL:** <https://forum.ansible.com/t/template-backups-in-conf-d-style-locations/16502>\
**Category:** Ansible Project\
**Created:** [October 14, 2014, 8:50am UTC](https://forum.ansible.com/t/template-backups-in-conf-d-style-locations/16502 "2014-10-14T08:50:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Josef\_Spak](https://avatars.discourse-cdn.com/v4/letter/j/ecae2f/32.png) [@Josef\_Spak](https://forum.ansible.com/u/Josef_Spak)\
**Post date:** [October 14, 2014, 8:50am UTC](https://forum.ansible.com/t/template-backups-in-conf-d-style-locations/16502/1 "2014-10-14T08:50:20Z")

</div>

I’ve just been auditing things and found that sometimes we used the template module with backups=yes even though it was configuring e.g. logrotate stuff in /etc/logrotate.d/

However, programs like logrotate may/will read all files in the directory, including the backups.

So perhaps this would be a useful tip.

I was also wondering - did anyone get burned by this?

Josef

---

<div class="post-metadata">

**Author:** ![adam2](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@adam2](https://forum.ansible.com/u/adam2)\
**Post date:** [October 14, 2014, 4:34pm UTC](https://forum.ansible.com/t/template-backups-in-conf-d-style-locations/16502/2 "2014-10-14T16:34:56Z")

</div>

Shouldn't such programs have a filter exclude setting? dpkg and rpm will both place temp files into .d style folders, while installing a package. I can't speak as to what temp extension rpm uses, but dpkg will create a $file.dpkg-new or $file.dpkg-old in such a folder. Plus, vim creates .$file.swp. So, it seems that these other programs will already need to have a way to exclude those files, and ansible should(or might already be) do something similar.

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [October 14, 2014, 4:47pm UTC](https://forum.ansible.com/t/template-backups-in-conf-d-style-locations/16502/3 "2014-10-14T16:47:49Z")

</div>

I've worked around it several ways:

- exclude specific extensions: \*~ (also works for editor backups)  
- include specific extensions: Include \*.conf  
- make the backups hidden: .backupfile

Also there might be an update in the works for making backups live on  
the 'master' not on the target machines. Currently you can simulate  
this with a fetch + file/absent set of tasks.
