]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/win32/cats/make_catalog_backup.cmd
kes Add Media.Enabled flag to client backups for dotcmds.c
[bacula/bacula] / bacula / src / win32 / cats / make_catalog_backup.cmd
1 #!/bin/sh\r
2 #\r
3 # This script dumps your Bacula catalog in ASCII format\r
4 # It works for MySQL, SQLite, and PostgreSQL\r
5 #\r
6 #  $1 is the name of the database to be backed up and the name\r
7 #     of the output file (default = bacula\r
8 #  $2 is the user name with which to access the database\r
9 #     (default = bacula).\r
10 #  $3 is the password with which to access the database or "" if no password\r
11 #     (default "")\r
12 #\r
13 #\r
14 cd %WORKING_DIR%\r
15 del /f bacula.sql\r
16 \r
17 set MYSQLPASSWORD=\r
18 \r
19 if "%3"!="" set MYSQLPASSWORD=" --password=%3"\r
20 %SQL_BINDIR%/mysqldump -u %2 %MYSQLPASSWORD% -f --opt %1 >%1.sql\r
21 \r
22 #\r
23 #  To read back a MySQL database use: \r
24 #     cd @working_dir@\r
25 #     rm -f @SQL_BINDIR@/../var/bacula/*\r
26 #     mysql <bacula.sql\r
27 #\r
28 #  To read back a SQLite database use:\r
29 #     cd @working_dir@\r
30 #     rm -f bacula.db\r
31 #     sqlite bacula.db <bacula.sql\r
32 #\r
33 #  To read back a PostgreSQL database use:\r
34 #     cd @working_dir@\r
35 #     dropdb bacula\r
36 #     createdb bacula\r
37 #     psql bacula <bacula.sql\r
38 #\r