Chinaunix首页 | 论坛 | 博客
  • 博客访问: 179519
  • 博文数量: 32
  • 博客积分: 3453
  • 博客等级: 上尉
  • 技术积分: 244
  • 用 户 组: 普通用户
  • 注册时间: 2008-05-04 21:27
文章分类
文章存档

2011年(8)

2010年(24)

分类: 服务器与存储

2010-04-26 02:40:44

vi /usr/local/bacula/etc/bacula-dir.conf


# mysql
  Job {
  Name = “bac-lab100-mysql”
  Type = “Backup”
  Level = Full
  Client = “lab100-fd”
  FileSet=”mysql-all-lab100″
  Schedule = “WeeklyCycle”
  Storage = “bac-file-lab100″
  Messages = “Standard”
  Pool = “Default”
  RunBeforeJob = “/usr/local/bacula//etc/make_mysqldump_all.sh bacuser bacuser mysqldump-all-lab100″
  RunAfterJob = “/usr/local/bacula//etc/delete_mysqldump_file.sh   mysqldump-all-lab100″
  Write Bootstrap = “/usr/local/bacula//var/bacula/working/lab100-mysql.bsr”
  Priority = 12
}

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
阅读(1833) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~