matrix-docker-ansible-deploy
matrix-docker-ansible-deploy copied to clipboard
Postgres Backup - Wrong number or backups (daily, weekly..)
Playbook Configuration:
My vars.yml
file looks like this:
# Postgres Backup
matrix_postgres_backup_enabled: true
matrix_postgres_backup_schedule: '@daily'
matrix_postgres_backup_keep_days: 2
matrix_postgres_backup_keep_weeks: 2
matrix_postgres_backup_keep_months: 2
Matrix Server:
- OS: Debian 11
- Architecture amd64
Problem description:
I'm looking at /matrix/postgres-backup/
folder and I have this situation:
root@pandora:/matrix/postgres-backup# ls -la daily/ [4/1570]
total 754472
drwxr-xr-x 2 matrix matrix 4096 Jun 23 02:00 .
drwx------ 6 matrix matrix 4096 Jun 12 13:21 ..
-rw-r--r-- 1 matrix matrix 2281394 Jun 20 02:01 matrix_mautrix_telegram-20220620.sql.gz
-rw-r--r-- 1 matrix matrix 2299000 Jun 21 02:01 matrix_mautrix_telegram-20220621.sql.gz
-rw-r--r-- 2 matrix matrix 2335869 Jun 22 02:00 matrix_mautrix_telegram-20220622.sql.gz
-rw-r--r-- 4 matrix matrix 2348215 Jun 23 02:00 matrix_mautrix_telegram-20220623.sql.gz
lrwxrwxrwx 1 matrix matrix 39 Jun 23 02:00 matrix_mautrix_telegram-latest.sql.gz -> matrix_mautrix_telegram-20220623.sql.gz
-rw-r--r-- 1 matrix matrix 88441 Jun 20 02:01 matrix_mautrix_whatsapp-20220620.sql.gz
-rw-r--r-- 1 matrix matrix 89369 Jun 21 02:01 matrix_mautrix_whatsapp-20220621.sql.gz
-rw-r--r-- 2 matrix matrix 94461 Jun 22 02:00 matrix_mautrix_whatsapp-20220622.sql.gz
-rw-r--r-- 4 matrix matrix 95639 Jun 23 02:00 matrix_mautrix_whatsapp-20220623.sql.gz
lrwxrwxrwx 1 matrix matrix 39 Jun 23 02:00 matrix_mautrix_whatsapp-latest.sql.gz -> matrix_mautrix_whatsapp-20220623.sql.gz
-rw-r--r-- 1 matrix matrix 881 Jun 20 02:01 matrix_reminder_bot-20220620.sql.gz
-rw-r--r-- 1 matrix matrix 881 Jun 21 02:01 matrix_reminder_bot-20220621.sql.gz
-rw-r--r-- 2 matrix matrix 948 Jun 22 02:00 matrix_reminder_bot-20220622.sql.gz
-rw-r--r-- 4 matrix matrix 917 Jun 23 02:00 matrix_reminder_bot-20220623.sql.gz
lrwxrwxrwx 1 matrix matrix 35 Jun 23 02:00 matrix_reminder_bot-latest.sql.gz -> matrix_reminder_bot-20220623.sql.gz
-rw-r--r-- 1 matrix matrix 243282414 Jun 20 02:01 synapse-20220620.sql.gz
-rw-r--r-- 1 matrix matrix 258633839 Jun 21 02:01 synapse-20220621.sql.gz
-rw-r--r-- 2 matrix matrix 128718089 Jun 22 02:00 synapse-20220622.sql.gz
-rw-r--r-- 4 matrix matrix 132244276 Jun 23 02:00 synapse-20220623.sql.gz
lrwxrwxrwx 1 matrix matrix 23 Jun 23 02:00 synapse-latest.sql.gz -> synapse-20220623.sql.gz
root@pandora:/matrix/postgres-backup# ls -la weekly/
total 513768
drwxr-xr-x 2 matrix matrix 4096 Jun 23 02:00 .
drwx------ 6 matrix matrix 4096 Jun 12 13:21 ..
-rw-r--r-- 1 matrix matrix 2119650 Jun 12 02:00 matrix_mautrix_telegram-202223.sql.gz
-rw-r--r-- 1 matrix matrix 2272002 Jun 19 02:01 matrix_mautrix_telegram-202224.sql.gz
-rw-r--r-- 4 matrix matrix 2348215 Jun 23 02:00 matrix_mautrix_telegram-202225.sql.gz
lrwxrwxrwx 1 matrix matrix 37 Jun 23 02:00 matrix_mautrix_telegram-latest.sql.gz -> matrix_mautrix_telegram-202225.sql.gz
-rw-r--r-- 1 matrix matrix 74160 Jun 12 02:00 matrix_mautrix_whatsapp-202223.sql.gz
-rw-r--r-- 1 matrix matrix 87318 Jun 19 02:01 matrix_mautrix_whatsapp-202224.sql.gz
-rw-r--r-- 4 matrix matrix 95639 Jun 23 02:00 matrix_mautrix_whatsapp-202225.sql.gz
lrwxrwxrwx 1 matrix matrix 37 Jun 23 02:00 matrix_mautrix_whatsapp-latest.sql.gz -> matrix_mautrix_whatsapp-202225.sql.gz
-rw-r--r-- 1 matrix matrix 778 Jun 12 02:00 matrix_reminder_bot-202223.sql.gz
-rw-r--r-- 1 matrix matrix 881 Jun 19 02:01 matrix_reminder_bot-202224.sql.gz
-rw-r--r-- 4 matrix matrix 917 Jun 23 02:00 matrix_reminder_bot-202225.sql.gz
lrwxrwxrwx 1 matrix matrix 33 Jun 23 02:00 matrix_reminder_bot-latest.sql.gz -> matrix_reminder_bot-202225.sql.gz
-rw-r--r-- 1 matrix matrix 155441081 Jun 12 02:00 synapse-202223.sql.gz
-rw-r--r-- 1 matrix matrix 231360917 Jun 19 02:01 synapse-202224.sql.gz
-rw-r--r-- 4 matrix matrix 132244276 Jun 23 02:00 synapse-202225.sql.gz
lrwxrwxrwx 1 matrix matrix 21 Jun 23 02:00 synapse-latest.sql.gz -> synapse-202225.sql.gz
What I don't understand is why I have 4 daily backups and 3 weekly, when my configuration says to keep 2 of each. Monthly doesn't count because I started this HS in May, so there are only 2 entries so far. Also not sure if 3 is actually correct (2 + current maybe) but 4 is obviously not.
https://github.com/prodrigestivill/docker-postgres-backup-local/issues/80
The devel of postgres-backup-local closed my issue, telling me to ask you instead (https://github.com/prodrigestivill/docker-postgres-backup-local/issues/80#issuecomment-1199545414), so I'm back with my original question, if anyone knows.
Same issue here. It also keeps 4 backups here instead of 2.
@roughnecks or @JulianGro: Please check the the "env" file installed from the matrix-docker-ansible-deploy playbook. It should be located at /postgres-backup/config/env. Please post it here but remove the credentials.