Bacula-users

Re: [Bacula-users] PostgreSQL - how to exclude bacula database?

2012-12-27 20:43:56
Subject: Re: [Bacula-users] PostgreSQL - how to exclude bacula database?
From: Jérôme Blion <jerome.blion AT free DOT fr>
To: bacula-users AT lists.sourceforge DOT net
Date: Fri, 28 Dec 2012 02:40:18 +0100
Hello,

Le 27/12/2012 22:21, Wolfgang Denk a écrit :
> Hi again,
>
> here is another PostgreSQL related question:  when backing up the
> database server, I would like to exclude the bacula database (which
> gets backed up separately anyway).
>
> With MySQL, I could do this easily with somthing like this:
>
>      Options {
>        RegexFile = "^/var/lib/mysql/mysql-bin."  # exclude MySQL replication 
> logs and index
>        RegexFile = "^/var/lib/mysql/bacula/"     # exclude bacula DB itself - 
> backup separately
>        RegexFile = "^/var/lib/mysql/ib"
>        Exclude = yes
>      }

To back up MySQL datadir, you should issue a FLUSH TABLES WITH READ 
LOCK, or you may have inconsistencies.
This will happen on databases which will move during the backup.

If you don't do that, you can loose data pieces.

> However, none of the PostgreSQL based examples I have seen so far
> contain similar (at least similar obvious) exclude rules. What am I
> missing here?

If you want to back up datafiles directly, you have to issue a 
pg_start_backup() and a pg_end_backup() to be sure your backup is 
consistent.
If you don't do that... you can have data loss too.

You can use pg_dump to backup databases separately. (as far as I know, 
the pg_dump creates consistent backup by defaults, whereas mysqldump 
does not by default)

Hope this helps.
Jerome Blion.

------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users