Ele também serve para standalone server.
pg_archivecleanup is designed to be used as an archive_cleanup_command to
clean up WAL file archives when running as a standby server (see Section
25.2 <http://www.postgresql.org/docs/9.1/static/warm-standby.html>).* **
pg_archivecleanup can also be used as a standalone program to clean WAL
file archives. *
Alan Aparício
@AlanAnalista <http://www.twitter.com/AlanAnalista>
http://www.comperjnews.com.br
"A verdadeira medida de um homem não é como ele se comporta em momentos de
conforto e conveniência, mas como ele se mantém em tempos de controvérsia e
desafio. "
(Martin Luther King Jr.)
2012/5/15 jorge sanfelice
> Tenho esse log da hora que deu o problema:
>
> May 15 03:16:58 nutella postgres[24425]: [7-1] user=,db=,host=LOG:
> archive command failed with exit code 1
> May 15 03:16:58 nutella postgres[24425]: [7-2] user=,db=,host=DETAIL: The
> failed archive command was: test ! -f
> /var/lib/pgsql/archives/0001002300F4 && cp
> pg_xlog/0001002300F4
> /var/lib/pgsql/archives/0001002300F4
> May 15 03:16:58 nutella postgres[24425]: [8-1] user=,db=,host=WARNING:
> transaction log file "0001002300F4" could not be archived: too
> many failures
> May 15 03:16:58 nutella postgres[24425]: [9-1] user=,db=,host=LOG:
> archive command failed with exit code 1
> May 15 03:16:58 nutella postgres[24425]: [9-2] user=,db=,host=DETAIL: The
> failed archive command was: test ! -f
> /var/lib/pgsql/archives/0001002300F4 && cp
> pg_xlog/0001002300F4
> /var/lib/pgsql/archives/0001002300F4
> May 15 03:16:59 nutella postgres[16606]: [25-1]
> user=sbtec,db=sascar,host=10.0.100.58(53397)LOG: duration: 1.217 ms
> statement: SELECT to_char(TIMESTAMP '2012-05-15T06:16:57' AT TIME ZONE
> 'GMT', 'dd/mm/ hh24:mi:ss') as aux_gmt;
> May 15 03:16:59 nutella postgres[24425]: [10-1] user=,db=,host=LOG:
> archive command failed with exit code 1
> May 15 03:16:59 nutella postgres[24425]: [10-2] user=,db=,host=DETAIL:
> The failed archive command was: test ! -f
> /var/lib/pgsql/archives/0001002300F4 && cp
> pg_xlog/0001002300F4
> /var/lib/pgsql/archives/0001002300F4
>
>
> Em 15 de maio de 2012 10:08, jorge sanfelice
> escreveu:
>
>
>> Sim estava limpando, mais nao com o comando pg_archivecleanup, esse cara
>> parece que é pra ser usado no server de standby.
>> (pg_archivecleanup is designed to be used as an archive_cleanup_commandto
>> clean up WAL file archives when running as a standby server)
>>
>>
>> Estranho que como mudei de 8.2 para 9.1 alguma coisa aconteceu que gerou
>> bem mais Arquive, consequentemente, acabei estimando errado o tamanho da
>> particao. (porque gerou mais, nao sei)
>>
>> De log nao achei nada, só esse processo no linux
>> -> postgres 32050 0.0 0.0 160740 1116 ?Ss 08:58 0:00
>> postgres: archiver process failed on
>> 0001002700A4.0708.backup
>>
>> Nao dei um restart no server ainda porque estou com duvidas se o banco
>> vai voltar de boa. Se parar esse banco agora nao vai ser bom.
>>
>> Mais Alguma ajuda ai galera?
>>
>> Em 15 de maio de 2012 09:58, william felipe_welter
>> escreveu:
>>
>> Em 15 de maio de 2012 09:28, jorge sanfelice
>>> escreveu:
>>> > Bom dia Pessoal,
>>> >
>>> > Tive um problema serio ontem durante o backup base + archive.
>>> > postgresql 9.1 + Oracle Linux
>>> >
>>> > A particao referente ao espaço em disco do Arquive estourou. (100% uso
>>> do
>>> > disco)
>>> > Obs: gerou muitos arquivos, a base de 85GB estava com 76GB de arquive
>>> (ta
>>> > certo que a base tem bastante transacoes)
>>> >
>>> > Configuracoes do arquive:
>>> > wal_level = archive
>>> > #fsync = on
>>> > #synchronous_commit = on
>>> > #wal_sync_method = fsync
>>> > #wal_writer_delay = 200ms
>>> >
>>> > #commit_delay = 0
>>> > #commit_siblings = 5
>>> >
>>> > # - Checkpoints -
>>> >
>>> > checkpoint_segments = 100
>>> > #checkpoint_timeout = 5min
>>> > #checkpoint_completion_target = 0.5
>>> > #checkpoint_warning = 30s
>>> >
>>> > # - Archiving -
>>> >
>>> > archive_mode = on # allows archiving to be done
>>> >
>>> > (Ta gerando muito arquivo refere