Sample Header Ad - 728x90

postgres - log archive_command execution

0 votes
1 answer
13 views
we want to have a an entz in the postgres logs upon execution of the archive_command. Someone came up with this archive_command which should achieve this test ! -f /opt/db/backup/postgres/archives/%f && echo $(date "+%F %T.%3N %Z") [$$] ARCH: archiving WAL: %f && cp %p /opt/db/backup/postgres/archives/%f The goal is to have a line telling us which wal file was archived at what time. it throws an error though
2025-08-07 18:06:44.184 CEST    FATAL:  invalid value for parameter "archive_command": "test ! -f /opt/db/backup/postgres/archives/%f && echo $(date "+%F %T.%3N %Z")
[$$] ARCH: archiving WAL: %f && cp %p /opt/db/backup/postgres/archives/%f"
2025-08-07 18:06:44.184 CEST    DETAIL:  String contains unexpected placeholder "%F".
Any idea how to adjust the archive command in order to get this going correctly?
Asked by vrms (271 rep)
Aug 7, 2025, 04:04 PM
Last activity: Aug 9, 2025, 02:07 PM