From 8689e2df025d869c82686b3a078304e8525f23f9 Mon Sep 17 00:00:00 2001 From: Roman Podoliaka Date: Wed, 11 Sep 2024 22:33:03 +0100 Subject: [PATCH] Actually run backup rotation in postgres-backups@.service Dry run example: ```shell Dry run. No changes will be made. Used space: 30 files, 133682908 bytes Freed space: 34 files, 151342898 bytes ``` --- roles/postgres/templates/postgres-backups@.service.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/postgres/templates/postgres-backups@.service.j2 b/roles/postgres/templates/postgres-backups@.service.j2 index 8952d5b..0361bbe 100644 --- a/roles/postgres/templates/postgres-backups@.service.j2 +++ b/roles/postgres/templates/postgres-backups@.service.j2 @@ -9,4 +9,4 @@ Group = postgres WorkingDirectory = {{ postgres_backups_dir }} ExecStartPre = +/usr/bin/chown postgres:postgres {{ postgres_backups_dir }} ExecStart = /usr/bin/bash -c "/usr/bin/pg_dump --compress=9 --no-owner --format=p --file=%i_$(TZ=UTC date +%%Y%%m%%d-%%H%%M%%S).sql.gz %i" -ExecStartPost = /usr/bin/python3 /usr/local/bin/rotate.py --keep 30 --dir {{ postgres_backups_dir }} +ExecStartPost = /usr/bin/python3 /usr/local/bin/rotate.py --no-dry-run --keep 30 --dir {{ postgres_backups_dir }}