# Way to recover latest backup?

**URL:** <https://forum.ansible.com/t/way-to-recover-latest-backup/12398>\
**Category:** Ansible Project\
**Created:** [February 21, 2013, 8:15am UTC](https://forum.ansible.com/t/way-to-recover-latest-backup/12398 "2013-02-21T08:15:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fdavis](https://avatars.discourse-cdn.com/v4/letter/f/a698b9/32.png) [@fdavis](https://forum.ansible.com/u/fdavis)\
**Post date:** [February 21, 2013, 8:15am UTC](https://forum.ansible.com/t/way-to-recover-latest-backup/12398/1 "2013-02-21T08:15:38Z")

</div>

Hello all,

So… If I needed to restore those ‘backup=true’ files for some conf on a few hundred hosts.  
Do we have something in place for this?

Lets say we run:

# the playbook that causes pain

---

<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:** [February 21, 2013, 3:23pm UTC](https://forum.ansible.com/t/way-to-recover-latest-backup/12398/2 "2013-02-21T15:23:08Z")

</div>

You can use a simple shell: to find all backups and get latest, register it and use that var in subsequent task to move it back into place.

---

<div class="post-metadata">

**Author:** ![Jay\_Looney](https://avatars.discourse-cdn.com/v4/letter/j/edb3f5/32.png) [@Jay\_Looney](https://forum.ansible.com/u/Jay_Looney)\
**Post date:** [July 12, 2017, 7:47pm UTC](https://forum.ansible.com/t/way-to-recover-latest-backup/12398/3 "2017-07-12T19:47:12Z")

</div>

Is this still true, because it really puts a damper on what I had hoped the solution would be which is something like patch, where you can just -R to reverse the patch file application. If that’s true I may switch from using the copy to actually apply changes and instead use the copy to get a file to the remote host and then apply the changes with patch.
