Keep the existing hook entrypoint and staged dump names. Allow RESTIC_STAGE_DIR for isolated tests. Use the local PostgreSQL socket with peer auth, never TCP. Required PostgreSQL or MongoDB backup failure must exit nonzero and preserve the prior successful dump. Successful dumps replace the old outputs. Tests: PostgreSQL failure returns nonzero and preserves previous dump; successful socket-authenticated PG and Mongo dumps publish fresh outputs.