Bacula Restore Using Ansible

Backups are an essential part of Systems Administration. And backups without validation are, to put it bluntly, useless. Here’s a simple ansible playbook that you can automate every day/week/month backup verification.

- hosts: bacula
  user: user
  sudo: True

  tasks:
  - name: Restore files from bacula for weekly backup tests
    shell: /bin/echo "restore before=2013-10-14\ 08:00:00 client={{ item }}-fd restoreclient={{ item }}-fd file=</root/bacula-restore-tests/{{ item }}.bcl where=/tmp/bacula-restores yes" | /usr/bin/bconsole
    with_items:
        - hostname1
        - hostname2
        - hostname3
        - hostname4
    ignore_errors: yes

Leave a Reply

Your email address will not be published. Required fields are marked *

 

Post Navigation