1

here is my configuration file:

wal_level = replica
archive_mode = on
archive_command = 'touch /var/backups/test'
archive_timeout = 1min

Permissions are ok. Postgres user can write into the aproppiate folder. I also restart the database to make sure the configuration goes through.

When running SELECT pg_switch_wal() I can see data under $PGDATA/pg_wal/, however there is nothing in /var/backup. Any ideas?

Saw that older question which is very alike: https://serverfault.com/questions/221791/postgresql-continuous-archiving-not-running-archive-command in my case permissions are okay.

Also, I can't seem to find any errors or warnings on the logs (When running docker logs )

2023-03-13 07:29:36.216 UTC [108] STATEMENT:  insert into prueba2 values (165);
2023-03-13 07:33:43.197 UTC [51] LOG:  checkpoint starting: time
2023-03-13 07:33:43.418 UTC [51] LOG:  checkpoint complete: wrote 2 buffers (0.0%); 0 WAL file(s) added, 0 removed, 1 recycled; write=0.101 s, sync=0.025 s, total=0.221 s; sync files=2, longest=0.017 s, average=0.013 s; distance=6606 kB, estimate=6606 kB
1
  • Probably better dummy command would be archive_command = 'touch /var/backups/%f where %f will be replaced by actual WAL file name e.g. 00000001000A69B000000087. But firstly make sure that the path /var/backups exists and can be written by postgres user. Commented Jan 11, 2024 at 11:34

1 Answer 1

2

First, perform the sanity check, connect to the database and run

SHOW archive_mode;
SHOW archive_command;

to ascertain that the settings are indeed as you think they are

To debug that further, you should resort to the log file. If the archive command is executed and encounters problems, those problems will leave a trace in the log. If you cannot see anything there, set log_min_messages to debug3, then you will get messages like

executing archive command "..."

whenever archive_command is executed.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.