必需重新編譯 dvd+rw-tools,讓它支援 bacula
wget http://fy.chalmers.se/~appro/linux/DVD+RW/tools/dvd+rw-tools-5.21.4.10.8.tar.gz
tar zxvf dvd+rw-tools-5.21.4.10.8.tar.gz
cd dvd+rw-tools-5.21.4.10.8.
patch -p1 < ../bacula-1.38.11/patches/dvd+rw-tools-5.21.4.10.8.bacula.patch

編譯
make

之後把產生的執行檔覆蓋於 /usr/bin目錄

測試
/usr/local/bacula/etc/dvd-handler /dev/dvd test

設定 DVD設備

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

# 加入 DVD device設定
#
# A DVD device
#
Device {
   Name = "DVD-Writer"
   Media Type = DVD
   Archive Device = /dev/hdd
# lets Bacula label unlabeled media
   LabelMedia = yes;
   Random Access = Yes;
# when device opened, read it
   AutomaticMount = yes;
   RemovableMedia = yes;
   AlwaysOpen = yes;
   #MaximumPartSize = 800M;
   RequiresMount = yes;
   MountPoint = /media/dvd;
# %a = Archive device name
# %m = mount point
   MountCommand = "/bin/mount -t iso9660 -o ro %a %m";
   UnmountCommand = "/bin/umount %m";
   SpoolDirectory = /usr/local/bacula/backup;
# %e = erase (set if cannot mount and first part)
# %v = last part name (i.e. filename)
   WritePartCommand = "/usr/local/bacula/etc/dvd-handler %a write %e %v"
   FreeSpaceCommand = "/usr/local/bacula/etc/dvd-handler %a free"
}

mkdir /usr/local/bacula/backup

mkdir /media/dvd

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

## [ cross ]
Job {
  Name = "bac-cross"
  Type = "Backup"
  Level = Incremental
  Client = "cross-fd"
  FileSet = "fileset-cross"
  Schedule = "WeeklyCycle"
  Storage = "bac-dvd-cross"
  Messages = "Standard"
  Pool = "Default"
  Write Bootstrap = "/usr/local/bacula/var/bacula/working/cross.bsr"
  Priority = 12
  Write Part After Job = yes
}

FileSet {
  Name = "fileset-cross"
  Include {
               Options {
                             compression=GZIP
                             signature = MD5
               }
               File = /root
  }
}

Client {
  Name = "cross-fd"
  Address = "192.168.1.12"
  FDPort = "9102"
  Catalog = MyCatalog
  Password = "smocpassword"
  File Retention = 30 days
  Job Retention = 6 months
  AutoPrune = yes
}

Storage {
  Name = bac-dvd-cross
  Address = 192.168.1.12
  SDPort = 9103
  Password = "smocpassword"
  Device = DVD-Writer
  Media Type = DVD
}
## [ cross ] END

   /usr/local/bacula/etc/bacula restart

把 bac-dvd-cross作個 Label
/usr/local/bacula/etc/bconsole
*label
      -> x: bac-dvd-cross

接下來就直接跑個 Job吧

備份之前的準備動作,執行
/usr/local/bacula/etc/dvd-handler /dev/hdd prepare

附註:
指令抹除光碟片
快速
dd if=/dev/zero bs=1025 count=512 | growisofs -Z /dev/hdd=/dev/fd/0

完整
growisofs -Z /dev/hdd=/dev/zero

燒錄
growisofs -Z /dev/hdd FILENAME

續燒
growisofs -M /dev/hdd FILENAME

Related posts 相關文章
備份 VSCode 設定
More...
Linux 救援光碟 SystemRescueCd,支援Windows,也可以遠端備份還原
More...
使用 mondo 線上備份linux centos 系統
More...
linux 的 dd + nc 線上備份主機硬碟
More...

作者

留言

撰寫回覆或留言

發佈留言必須填寫的電子郵件地址不會公開。