# Schedule periodic backup task

**URL:** <https://forum.ansible.com/t/schedule-periodic-backup-task/24616>\
**Category:** Ansible Project\
**Created:** [June 1, 2017, 10:09am UTC](https://forum.ansible.com/t/schedule-periodic-backup-task/24616 "2017-06-01T10:09:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mitiryl](https://avatars.discourse-cdn.com/v4/letter/m/aca169/32.png) [@Mitiryl](https://forum.ansible.com/u/Mitiryl)\
**Post date:** [June 1, 2017, 10:09am UTC](https://forum.ansible.com/t/schedule-periodic-backup-task/24616/1 "2017-06-01T10:09:03Z")

</div>

Hi everyone,

I need to perform every night a backup of our databases. At the moment, we use Ansible cron module to set up a python script that runs on the remote machine every night. The same operation could be done using an Ansible playbook instead of the python script. I would like to know your opinion about scheduling, with cron module, an Ansible playbook, runned against the local machine.  
What do you think about this approach?

---

<div class="post-metadata">

**Author:** ![Paul\_Markham](https://avatars.discourse-cdn.com/v4/letter/p/9d8465/32.png) [@Paul\_Markham](https://forum.ansible.com/u/Paul_Markham)\
**Post date:** [June 2, 2017, 12:33am UTC](https://forum.ansible.com/t/schedule-periodic-backup-task/24616/2 "2017-06-02T00:33:01Z")

</div>

I have a bunch of Ansible jobs running from cron. Can’t see any issue with it, and it makes sense to use Ansible if it does what you need. The only time when I’d say it’s not a great idea is if all you’re doing is getting Ansible to run a single shell command.

---

<div class="post-metadata">

**Author:** ![Paul\_Markham](https://avatars.discourse-cdn.com/v4/letter/p/9d8465/32.png) [@Paul\_Markham](https://forum.ansible.com/u/Paul_Markham)\
**Post date:** [June 2, 2017, 12:35am UTC](https://forum.ansible.com/t/schedule-periodic-backup-task/24616/3 "2017-06-02T00:35:23Z")

</div>

Although, if you’re pulliing variables from an Ansible inventory, even just running a single shell command could make sense.
