master
omidshj 2025-02-05 21:07:36 +03:30
parent 36b2bb5d32
commit 789321ff37
1 changed files with 9 additions and 1 deletions

View File

@ -9,5 +9,13 @@
--username {{ mongodb_user }}
--password {{ mongodb_password }}
--authenticationDatabase admin
--out {{ backup_dir }}
--out {{ mongo_backup_dir }}
with_items: "{{ db_names }}"
- name: Get the current weekday
shell: date +%a
register: weekday
changed_when: false
- name: Archive each directory separately
command: >
tar -czf "{{ backup_dir }}/{{ item }}-{{ weekday.stdout }}.tar.gz" -C "{{ backup_dir }}" "{{ item }}"
loop: "{{ db_names }}"