Linux

無法使用 Bacula 備份 Windows 目錄

  • November 15, 2017

備份和恢復在 Linux 上工作

Bacula 的 Director ( DIR )、File Daemon ( FD ) 和 Storage Daemon ( SD ) 已安裝在 Linux 主機上,已執行備份並且可以恢復文件。

在 Windows 上備份失敗

下一步是備份駐留在 Windows 上的文件。FD已安裝並在 Windows 上執行:

C:\Program Files\Bacula>netstat -nat | grep 91
 TCP    0.0.0.0:9102           0.0.0.0:0              LISTENING       InHost

 TCP    0.0.0.0:9102           0.0.0.0:0              LISTENING       InHost

Telnet 表明 Windows 主機能夠連接到位於 Linux 上的DIRSD :

在此處輸入圖像描述

無法統計“c:\temp”:ERR=沒有這樣的文件或目錄

C:\Program Files\Bacula>bconsole
Connecting to Director IP1:9101
1000 OK: bacula-dir Version: 5.0.0 (26 January 2010)
Enter a period to cancel a command.
*run
Automatically selected Catalog: MyCatalog
Using Catalog "MyCatalog"
A job name must be specified.
The defined Job resources are:
    1: BackupClient1
    2: BackupCatalog
    3: RestoreFiles
Select Job resource (1-3): *1
Run Backup job
JobName:  BackupClient1
Level:    Incremental
Client:   bacula-fd
FileSet:  Full Set
Pool:     File (From Job resource)
Storage:  File (From Job resource)
When:     2014-08-28 21:55:37
Priority: 10
OK to run? (yes/mod/no): *yes
Job queued. JobId=16
You have messages.
*messages
28-Aug 21:42 bacula-dir: ERROR in authenticate.c:304 UA Hello from client:IP1:PORT is invalid. Len=-4
28-Aug 21:55 bacula-dir JobId 16: Start Backup JobId 16, Job=BackupClient1.2014-
08-28_21.55.41_09
28-Aug 21:55 bacula-dir JobId 16: Using Device "FileStorage"
28-Aug 21:55 bacula-sd JobId 16: Volume "hello" previously written, moving to en
d of data.
28-Aug 21:55 bacula-sd JobId 16: Ready to append to end of Volume "hello" size=5
6881490
28-Aug 21:55 bacula-fd JobId 16:      Could not stat "c:\temp": ERR=No such file
or directory
28-Aug 21:55 bacula-sd JobId 16: Job write elapsed time = 00:00:01, Transfer rat
e = 0  Bytes/second
28-Aug 21:55 bacula-dir JobId 16: Bacula bacula-dir 5.0.0 (26Jan10): 28-Aug-2014
21:55:44
 Build OS:               x86_64-redhat-linux-gnu redhat (Carbon)
 JobId:                  16
 Job:                    BackupClient1.2014-08-28_21.55.41_09
 Backup Level:           Incremental, since=2014-08-28 21:22:07
 Client:                 "bacula-fd" 5.0.0 (26Jan10) x86_64-redhat-linux-gnu,re
dhat,(Carbon)
 FileSet:                "Full Set" 2014-08-28 20:36:03
 Pool:                   "File" (From Job resource)
 Catalog:                "MyCatalog" (From Client resource)
 Storage:                "File" (From Job resource)
 Scheduled time:         28-Aug-2014 21:55:37
 Start time:             28-Aug-2014 21:55:44
 End time:               28-Aug-2014 21:55:44
 Elapsed time:           0 secs
 Priority:               10
 FD Files Written:       0
 SD Files Written:       0
 FD Bytes Written:       0 (0 B)
 SD Bytes Written:       0 (0 B)
 Rate:                   0.0 KB/s
 Software Compression:   None
 VSS:                    no
 Encryption:             no
 Accurate:               no
 Volume name(s):
 Volume Session Id:      4
 Volume Session Time:    1409258126
 Last Volume Bytes:      56,881,890 (56.88 MB)
 Non-fatal FD errors:    1
 SD Errors:              0
 FD termination status:  OK
 SD termination status:  OK
 Termination:            Backup OK -- with warnings

28-Aug 21:55 bacula-dir JobId 16: Begin pruning Jobs older than 44 years 2 month
s 10 days 21 hours 55 mins 44 sec.
28-Aug 21:55 bacula-dir JobId 16: No Jobs found to prune.
28-Aug 21:55 bacula-dir JobId 16: Begin pruning Jobs.
28-Aug 21:55 bacula-dir JobId 16: No Files found to prune.
28-Aug 21:55 bacula-dir JobId 16: End auto prune.

*

問題

為什麼 FD 指示 c:\temp 存在時無法備份?

C:\Program Files\Bacula>dir c:\ | findstr temp
08/25/2014  12:40 AM    <DIR>          temp

Could not stat "c:\temp": ERR=No such file or directorywhile c:\tempexists 表示由於某種原因無法找到該目錄。原因是FD應該在要備份的主機上執行。

在此處輸入圖像描述

  1. 通過複製 linux FD並將 localhost 更改為 IP2 或 FQDN2 ,將 Windows 客戶端 ( FD ) 添加到 /etc/bacula/bacula-dir.conf
  2. 將位於 Job 部分的 Client 更改為FD的名稱
  3. 將位於 FileSet 中的文件更改或添加到例如 c:/temp
  4. 檢查linux主機的IP1或FQDN1是否已配置為SD主機(應避免使用localhost,因為外部FD無法訪問)
  5. 重啟DIRSD
  6. 執行sudo bconsole
  7. 執行狀態客戶端並選擇Windows客戶端
  8. 執行 Bacula 命令以備份和還原 Windows 文件

/etc/bacula/bacula-dir.conf

JobDefs {
 Name = "DefaultJob"
 Type = Backup
 Level = Incremental
 Client = utrecht-fd
 FileSet = "Full Set"
 ...
}

Client {
 Name = utrecht-fd
 Address = IP2
 FDPort = 9102
 ...
}

Storage {
 Name = File
 Address = IP1
 SDPort = 9103
 ...
 Device = FileStorage
 ...
}

FileSet {
 Name = "Full Set"
 ...
 File = c:/test
 ...
}

引用自:https://serverfault.com/questions/624844