--- /dev/null
+@ECHO off\r
+REM \r
+REM This script dumps your Bacula catalog in ASCII format\r
+REM It works for MySQL, SQLite, and PostgreSQL\r
+REM \r
+REM %1 is the name of the database to be backed up and the name\r
+REM of the output file (default = bacula\r
+REM %2 is the user name with which to access the database\r
+REM (default = bacula).\r
+REM %3 is the password with which to access the database or "" if no password\r
+REM (default "")\r
+REM \r
+REM \r
+@ECHO on\r
+\r
+DEL /f "@working_dir_cmd@\%1.sql" 2>nul\r
+\r
+SET PGPASSWORD=\r
+\r
+IF NOT "%3"=="" SET PGPASSWORD=--password=%3\r
+"@SQL_BINDIR@\pg_dump" -c -U %2 %1 >"@working_dir_cmd@\%1.sql"\r
+\r
+@ECHO off\r
+REM \r
+REM To read back a MySQL database use: \r
+REM cd @working_dir_cmd@\r
+REM rd /s /q @SQL_BINDIR@\..\data\bacula\r
+REM mysql < bacula.sql\r
+REM \r
+REM To read back a SQLite database use:\r
+REM cd @working_dir_cmd@\r
+REM del /f bacula.db\r
+REM sqlite bacula.db < bacula.sql\r
+REM \r
+REM To read back a PostgreSQL database use:\r
+REM cd @working_dir_cmd@\r
+REM dropdb bacula\r
+REM createdb -T template0 -E SQL_ASCII bacula\r
+REM psql bacula < bacula.sql\r
+REM \r
+EXIT /b 0\r