From 120b69070f637524fe067edab3f3cf87c9415d77 Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 23 Nov 2021 14:16:23 +0100 Subject: [PATCH] Move daily backups. --- semaphore.yaml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/semaphore.yaml b/semaphore.yaml index 2b9fddb..9907a2d 100644 --- a/semaphore.yaml +++ b/semaphore.yaml @@ -58,5 +58,15 @@ recurse: false register: backup_files loop: "{{ backup_dirs.files }}" + loop_control: + label: "{{ item.path }}" - - debug: var=backup_files + - name: Store the daily backup + copy: + remote_src: true + src: "{{ item.path }}" + dest: "{{ item.path | dirname }}/daily/{{ item.path | basename }}" + with_items: "{{ backup_files.results | map(attribute='files') | list }}" + when: (ansible_date_time.weekday_number != "1" and ansible_date_time.day != "01") + loop_control: + label: "{{ item.path }}"