pg_retainxlog is a tool to use as PostgreSQL archive_command when using pg_receivexlog