Re: Out of space making backup

From: Brian Modra <epailty(at)googlemail(dot)com>
To: Farhan Malik <malikpiano(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Out of space making backup
Date: 2009-12-25 16:44:53
Message-ID: 5a9699850912250844y5a4aead9k9dfb94277f339323@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

2009/12/25 Farhan Malik <malikpiano(at)gmail(dot)com>:
>> Reading between the lines, I suspect you are trying to use 'tar' output
>> format, which does have a need to make temp files that can be large.
>> If I guessed right, I'd suggest using 'custom' format instead.  There
>> really is no advantage to tar format, and several disadvantages besides
>> this one.
>>
>>                        regards, tom lane
>
> That sounds right.  The error I get from the software is 2009/12/25
> 10:21:40.812: [00001EA8][ThreadBackupRestore] Restore Error: pg_dump:
> [tar archiver] could not write to output file: No space left on device
>
> Is there a way to have postgre put those large temp files on a
> different drive?  I only have 4GB free on my C: drive and once the
> temp files go over that I get an out of space error.  I have tons of
> free space on other drives, including the one where I am asking that
> the final backup.zip file goes.
>
> As for changing the backup to a custom format, I will pass that on to
> the developer of the software.

I do backups semi-manually:

use select pg_start_backup('some-name') (in psql logged in a postres)
then start a tar of /var/lib/pgsql/data/, to stdout and pipe this to
tar on another server using ssh
then finally select pg_stop_backup()

e.g. my two scripts (backup.sh calls back1.sh

[root(at)www pgsql]# cat back1.sh
#/bin/bash
cd /var/lib/pgsql
ssh lead touch /var/lib/postgresql/backups/start_backup
tar zcf - data |ssh lead "cat > /var/lib/postgresql/backups/20091223.tgz"
echo "DONE"
[root(at)www pgsql]# cat backup.sh
#!/bin/bash
cd /var/lib/pgsql
./back1.sh > backups/backup.log 2>&1 </dev/null &
[root(at)www pgsql]#

>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

--
Brian Modra Land line: +27 23 5411 462
Mobile: +27 79 69 77 082
5 Jan Louw Str, Prince Albert, 6930
Postal: P.O. Box 2, Prince Albert 6930
South Africa
http://www.zwartberg.com/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rob Jaeger 2009-12-25 17:02:30 Finding the bin path
Previous Message Farhan Malik 2009-12-25 16:35:01 Re: Out of space making backup