On Wed, Jun 10, 2015 at 7:27 AM, Joshua D. Drake <jd@commandprompt.com> wrote:
> Trying to use pg_archivecleanup as a:
>
> "standalone archive cleaner"
>
> Results in an error of:
>
> pg_archivecleanup: invalid filename input
> Try "pg_archivecleanup --help" for more information.
>
> /usr/pgsql-9.4/bin/pg_archivecleanup /backups/db1/archive
> 0000000100000748000000B1.00015838.backup
> Works.
Yes.
> /usr/pgsql-9.4/bin/pg_archivecleanup /backups/db1/archive
> ./0000000100000748000000B1.00015838.backup
> Or
> /usr/pgsql-9.4/bin/pg_archivecleanup /backups/db1/archive
> /backups/db1/archive/0000000100000748000000B1.00015838.backup
> Do not and present with the error mentioned above.
Looking at the documentation what is expected is not a path to a
segment file, but only a segment file name:
http://www.postgresql.org/docs/devel/static/pgarchivecleanup.html
So the current behavior is correct, it is actually what
SetWALFileNameForCleanup@pg_archivecleanup.c checks in the code.
Speaking of which, 179cdd09 has forgotten pg_archivecleanup.c, making
XLOG_DATA_FNAME_LEN not needed. XLOG_BACKUP_FNAME_LEN could be removed
as well and IsBackupHistoryFileName() should be made smarter by
checking that the length of the backup file name is actually 40...
Regards,
--
Michael