3 REM This script dumps your Bacula catalog in ASCII format
\r
4 REM It works for MySQL, SQLite, and PostgreSQL
\r
6 REM %1 is the name of the database to be backed up and the name
\r
7 REM of the output file (default = bacula
\r
8 REM %2 is the user name with which to access the database
\r
9 REM (default = bacula).
\r
10 REM %3 is the password with which to access the database or "" if no password
\r
16 DEL /f "@working_dir_cmd@\%1.sql" 2>nul
\r
18 ECHO .dump | "@bin_dir_cmd@\sqlite3" "@working_dir_cmd@\%1.db" > "@working_dir_cmd@\%1.sql"
\r
22 REM To read back a MySQL database use:
\r
23 REM cd @working_dir_cmd@
\r
24 REM rd /s /q @SQL_BINDIR@\..\data\bacula
\r
25 REM mysql < bacula.sql
\r
27 REM To read back a SQLite database use:
\r
28 REM cd @working_dir_cmd@
\r
29 REM del /f bacula.db
\r
30 REM sqlite bacula.db < bacula.sql
\r
32 REM To read back a PostgreSQL database use:
\r
33 REM cd @working_dir_cmd@
\r
36 REM psql bacula < bacula.sql
\r