From f6a1e30a9ad1d8bc547e2004e48bb50c098abcdd Mon Sep 17 00:00:00 2001 From: Christian Steinle Date: Wed, 17 Nov 2021 11:32:53 +0100 Subject: [PATCH] Tasks for backing up postgres databases. --- host.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/host.yaml b/host.yaml index 624939e..17e38da 100644 --- a/host.yaml +++ b/host.yaml @@ -21,4 +21,16 @@ - bookstack - kimai - semaphore + + - name: Backup postgres databases + shell: docker exec psql14 psql14 -U {{ postgres_user }} {{ item }} > /home/chris/{{ item }}_{{ ansible_date_time.iso8601_basic_short }}.sql + loop: + - gitea + - nextcloud + - name: Compress postgres backup files + shell: gzip /home/chris/{{ item }}_{{ ansible_date_time.iso8601_basic_short }}.sql + loop: + - gitea + - nextcloud + \ No newline at end of file