]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/win32/cats/make_catalog_backup.cmd
Change daemons and utilities so that if -c is omitted from the command line AND there...
[bacula/bacula] / bacula / src / win32 / cats / make_catalog_backup.cmd
1 @echo off\r
2 rem \r
3 rem  This script dumps your Bacula catalog in ASCII format\r
4 rem  It works for MySQL, SQLite, and PostgreSQL\r
5 rem \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
11 rem      (default "")\r
12 rem \r
13 rem \r
14 @echo on\r
15 \r
16 cd @working_dir@\r
17 del /f bacula.sql 2>nul\r
18 \r
19 set MYSQLPASSWORD=\r
20 \r
21 if not "%3"=="" set MYSQLPASSWORD=--password=%3\r
22 "@SQL_BINDIR@\mysqldump" -u %2 %MYSQLPASSWORD% -f --opt %1 >%1.sql\r
23 \r
24 @echo off\r
25 rem \r
26 rem   To read back a MySQL database use: \r
27 rem      cd @working_dir@\r
28 rem      rd /s /q -f @SQL_BINDIR@\..\data\bacula\r
29 rem      mysql <bacula.sql\r
30 rem \r
31 rem   To read back a SQLite database use:\r
32 rem      cd @working_dir@\r
33 rem      rm -f bacula.db\r
34 rem      sqlite bacula.db <bacula.sql\r
35 rem \r
36 rem   To read back a PostgreSQL database use:\r
37 rem      cd @working_dir@\r
38 rem      dropdb bacula\r
39 rem      createdb bacula\r
40 rem      psql bacula <bacula.sql\r
41 rem \r