3 # This script dumps your Bacula catalog in ASCII format
4 # It works for MySQL, SQLite, and PostgreSQL
6 # $1 is the name of the database to be backed up and the name
7 # of the output file (default = bacula).
8 # $2 is the user name with which to access the database
14 if test xsqlite = x@DB_NAME@ ; then
15 echo ".dump" | @SQL_BINDIR@/sqlite $1.db >$1.sql
17 if test xmysql = x@DB_NAME@ ; then
18 @SQL_BINDIR@/mysqldump -u $2 -f --opt $1 >$1.sql
20 @SQL_BINDIR@/pg_dump -U $2 $1 >$1.sql
24 # To read back a MySQL database use:
26 # rm -f @SQL_BINDIR@/../var/bacula/*
27 # mysql bacula <bacula.sql
29 # To read back a SQLite database use:
32 # sqlite bacula.db <bacula.sql
34 # To read back a PostgreSQL database use:
37 # psql bacula <bacula.sql