分类: 服务器与存储
2010-04-26 02:40:44
vi /usr/local/bacula/etc/bacula-dir.conf
FileSet {
Name = “mysql-all-lab100″
Include {
Options {
signature = MD5
compression=GZIP
}
File = /usr/local/bacula//var/bacula/working/mysqldump-all-lab100.sql
}
}
# postgresql
Job {
Name = “bac-lab100-postgresql”
Type = “Backup”
Level = Full
Client = “lab100-fd”
FileSet=”postgresql-lab100″
Schedule = “WeeklyCycle”
Storage = “bac-file-lab100″
Messages = “Standard”
Pool = “Default”
RunBeforeJob = “/usr/local/bacula//etc/make_pgdump.sh”
RunAfterJob = “/usr/local/bacula//etc/delete_pgdump_file.sh”
Write Bootstrap = “/usr/local/bacula//var/bacula/working/lab100-postgresql.bsr”
Priority = 12
}
FileSet {
Name = “postgresql-lab100″
Include {
Options {
signature = MD5
compression=GZIP
}
File = /usr/local/bacula//var/bacula/working/pgdump-lab100-smoc.sql
File = /usr/local/bacula//var/bacula/working/pgdump-lab100-interchannel.sql
File = /usr/local/bacula//var/bacula/working/pgdump-lab100-sendmail-sig.sql
}
}
vi /usr/local/bacula/etc/make_mysqldump_all.sh
#!/bin/sh#
cd /usr/local/bacula//var/bacula/working
/usr/local/mysql//bin/mysqldump -u $1 -p$2 -f –opt -A > $3.sql
vi /usr/local/bacula/etc/make_pgdump.sh
#!/bin/sh#
cd /usr/local/bacula//var/bacula/working
pgdump=”/usr/bin/pg_dump”
$pgdump interchannel -U icmanager > pgdump-lab100-interchannel.sql
$pgdump sendmail_sig -U postgres > pgdump-lab100-sendmail-sig.sql
$pgdump smoc_tmp -U smoc > pgdump-lab100-smoc.sql
vi /usr/local/bacula/etc/delete_mysqldump_file.sh
#!/bin/sh
# 2006/11/01 fixed by cross@ssorc.tw
#
rm -f /usr/local/bacula//var/bacula/working/$1*.sql
vi /usr/local/bacula/etc/delete_pgdump_file.sh
#!/bin/sh
# 2006/11/01 fixed by cross@ssorc.tw
#
rm -f /usr/local/bacula//var/bacula/working/pgdump*.sql