From 4302e3c7eb41bcaeac0d11fbcf32bd62efab82c5 Mon Sep 17 00:00:00 2001 From: omidshj Date: Fri, 12 Jul 2024 20:25:36 +0330 Subject: [PATCH] backup i3 --- backup-i3.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 backup-i3.yml diff --git a/backup-i3.yml b/backup-i3.yml new file mode 100644 index 0000000..8519503 --- /dev/null +++ b/backup-i3.yml @@ -0,0 +1,13 @@ +--- +- name: Create tar file with dynamic date + hosts: all + tasks: + - name: Set current date + ansible.builtin.set_fact: + current_date: "{{ lookup('pipe', 'date +%Y-%m-%d') }}" + + - name: Archive volumes + ansible.builtin.archive: + path: /var/lib/docker/volumes # Replace with the path of the directory or files you want to archive + dest: "/root/backups/volumes-{{ current_date }}.tar.gz" # Replace with the desired destination path + format: gz