On Wed, 13 Jun 2007, Alvaro Herrera wrote:

Johannes Konert wrote:
I currently write a small script that deletes outdated xlog-files from
my backup-location.

Warning, this is NOT SAFE to do.  You should NEVER delete "outdated"
xlog files, unless you appreciate RANDOM CORRUPTION of your data.

He's talking about wiping out the ones on the backup server, so I think Johannes means erasing the old archived logs on the secondary here. That can screw up your backup if you do it wrong, but it's not an all-caps worthy mistake.

On Wed, 13 Jun 2007, Johannes Konert wrote:
Because I do not want to rely on creation-date,

No, you want to rely on creation date, because then this problem goes away. The idea you should be working toward is that you identify when your last base backup was started after it's copied to the secondary, and then you can safely delete any archived logs file on the secondary from before that time. Instead of doing "ls | sort -g -r" you should be doing something like looping over the files in a bash shell script and using
[ -ot <first xlog in base backup> ] to determine which files to delete.

--
* Greg Smith [EMAIL PROTECTED] http://www.gregsmith.com Baltimore, MD

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to