From c5a7a0cc98e01c6a950f67a42fb69c04dc5d2fb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christer=20War=C3=A9n?= Date: Mon, 23 Dec 2024 17:58:14 +0200 Subject: [PATCH] Tasks Update: Backup --- tasks/backup.yml | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/tasks/backup.yml b/tasks/backup.yml index c3c11a5..59c1c00 100644 --- a/tasks/backup.yml +++ b/tasks/backup.yml @@ -4,33 +4,15 @@ name: minecraft state: stopped -- name: "Backup - Minecraft - Create Directory" - ansible.builtin.file: - path: ~/data/backups/tmp - state: directory - -- name: "Backup - Minecraft - Copy" - ansible.builtin.copy: - src: "~/data/minecraft" - dest: "~/data/backups/tmp" - -- name: "Backup - Minecraft - Delete" - ansible.builtin.file: - path: ~/data/backups/tmp/minecraft/plugins/dynmap/web/tiles - state: absent - - name: "Backup - Minecraft - Save" community.general.archive: path: - - "~/data/backups/tmp/minecraft" - dest: "~/data/backups/minecraft-{{ ansible_facts.date_time.date }}.zip" + - "~/data/minecraft" + exclusion_patterns: + - "plugins/dynmap/web/tiles/*" + dest: "~/data/backups/minecraft-{{ ansible_facts.date_time.date + '-' + ansible_facts.date_time.hour + '-' + ansible_facts.date_time.minute + '-' + ansible_facts.date_time.second }}.zip" format: zip -- name: "Backup - Minecraft - Clean" - ansible.builtin.file: - path: ~/data/backups/tmp/minecraft - state: absent - - name: "Backup - Minecraft - Start" containers.podman.podman_container: name: minecraft