Re: Backup SQL databases

Boris Goldowsky <boris-FrUbXkNCsVf2fBVCVOL8/[email protected]> Tue, 13 Jul 2004 21:46:02 -0400
Newsgroups gmane.comp.sysutils.backup.hdup.general
Message-ID <[email protected]>
On Jul 13, 2004, at 7:04 AM, Miek Gieben wrote:

> [On 13 Jul, @13:01, Dennis wrote in "[hdup-user] Backup SQL databas 
> ..."]
>> Hi.
>>
>> Is it possible to backup MySQL or Postgresql databases?
>
> well, I'm doing a backup of the database files of mysql, which looks
> to be working. I have no experience with postgresql.

You can also back up postgres's data directory, but you could end up 
with an inconsistent snapshot being backed up -- and so perhaps a 
corrupted database after a restore -- if any changes were made in the 
database during the time the backup was running.
>
> You can also use a "prerun" script to dump the database before the
> backup starts. But this will break incremental dumps of course.

This would be the safer course.  Alternatively, you could use the 
prerun script to turn off the database sever, and a postrun script to 
turn it back on, so that you'd be sure no changes were made during that 
period.

If you need both a continuously-modifiable database and true 
incremental backups, you might be able to use an rsync-based backup 
strategy.

Boris