backup i3

master
omidshj 2024-07-12 20:25:36 +03:30
parent abe2e10d42
commit 4302e3c7eb
1 changed files with 13 additions and 0 deletions

13
backup-i3.yml Normal file
View File

@ -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