Created
March 26, 2023 18:55
-
-
Save xholicka/8f548ff1a88e54816449999b79006ea2 to your computer and use it in GitHub Desktop.
Ansible playbook to backup home directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Backup home directory | |
hosts: localhost | |
vars: | |
date: "{{ lookup('pipe', 'date +%Y%m%d-%H%M') }}" | |
tasks: | |
- name: Create archive of home directory | |
community.general.archive: | |
path: /home/pi/ | |
dest: "/mnt/nas/Backups/pi3backups/home{{ date }}.tar.gz" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment