Re: [Bacula-users] backup of another database beyond the catalog
2010-02-15 09:37:32
Hi,
You can backup postgresql in three different ways: 1. dumping database or postgresql cluster to file using pg_dump, then backing up those file (semi hot backup) 2. backing up all postgresql cluster data files and postgresql wal files using postgresql pitr feature (hot backup)
3. backing up all postgresql cluster data files when postgresql instance is shut down (cold backup) Only 2. and 3. backup methods can guarantee data consistency. #1 require additional free space where You can temporary store file dump and doesn't guarantee data consistency.
regards
Radek
2010/2/15 Marco Zancanaro <marco.zanca AT gmail DOT com>
Hi, i need to backup a postgresql database. This database is not the catalog database, but another database that i want to backup. It is possibile to automate this backup with bacula? I take a look into /etc/bacula/sripts/make_catalog_backup, i think to create a similar script, something like this:
exec ${BINDIR}/pg_dump -c $PGHOST -U ${DB_USERNAME} ${DB_NAME} >${DB_NAME}.sql
And create a job like this:
Job { Name = "BackupPostgresqlDataBase" JobDefs = "DefaultJob"
Level = Full FileSet="Database" Schedule = "WeeklyCycleAfterBackup" RunBeforeJob = "/etc/bacula/scripts/make_database_backup" # RunAfterJob = "/etc/bacula/scripts/delete_database_backup"
Write Bootstrap = "/var/lib/bacula/BackupDatabase.bsr" Priority = 11 }
FileSet { Name = "Database" Include { Options { signature = MD5 } File = /var/lib/bacula/database.sql
} }
I copy the RunAfetJob line from the default catalog backup job, but i don't understand it. If before the job the script dumps the database, and after the file is deleted, what's the point? I don't get it.
The delete_database_backup script is a copy of the default delete_catalog_backup, which only do this: rm -f /var/lib/bacula/${db_name}.sql
There is any better way to do this? Thank you.
Regards Marco Zancanaro
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev _______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users
-- Radosław Korzeniewski radoslaw AT korzeniewski DOT net
------------------------------------------------------------------------------
SOLARIS 10 is the OS for Data Centers - provides features such as DTrace,
Predictive Self Healing and Award Winning ZFS. Get Solaris 10 NOW
http://p.sf.net/sfu/solaris-dev2dev _______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users
|
|
|