Application: Bacula v.3.2/v.5.2.
Итак, мы имеем установленную систему резервирования Bacula и клиента, данные которого подлежат резервированию. Уточним конфигурацию, имеющую отношение к тестируемой схеме:
# cat /etc/bacula/bacula-dir.conf
Pool {
Name = "pool-test0.domain.local"
Label Format = "test0.domain.local-"
Pool Type = Backup
Recycle = yes
AutoPrune = yes
Maximum Volumes = 14
Maximum Volume Jobs = 7
Volume Retention = 93 days
}
Client {
Name = "client-test0.domain.local"
Address = "test0.domain.local"
FDPort = 9102
Catalog = "cd0.backup.local"
Password = "strongPasswordForClient"
File Retention = 93 days
Job Retention = 93 days
AutoPrune = yes
}
FileSet {
Name = "file-set-test0.domain.local"
Include {
Options {
signature = SHA1
compression = GZIP
recurse = yes
noatime = yes
hardlinks = yes
}
File = "/etc"
File = "/home"
File = "/var/www"
}
Exclude {
File = "/proc"
File = "/tmp"
File = "/.journal"
File = "/.fsck"
}
}
Job {
Name = "job-backup-test0.domain.local"
Type = Backup
Rerun Failed Levels = yes
Reschedule On Error = Yes
Reschedule Interval = 50 minutes
Reschedule Times = 10
Client = "client-test0.domain.local"
FileSet = "file-set-test0.domain.local"
Schedule = "WeeklyFullDailyInc"
Maximum Concurrent Jobs = 1
Storage = "sd0.backup.local"
Messages = Standard
Pool = "pool-test0.domain.local"
Priority = 10
Write Bootstrap = "/mnt/storage/bacula/bsr/%n.bsr"
}
Name = "pool-test0.domain.local"
Label Format = "test0.domain.local-"
Pool Type = Backup
Recycle = yes
AutoPrune = yes
Maximum Volumes = 14
Maximum Volume Jobs = 7
Volume Retention = 93 days
}
Client {
Name = "client-test0.domain.local"
Address = "test0.domain.local"
FDPort = 9102
Catalog = "cd0.backup.local"
Password = "strongPasswordForClient"
File Retention = 93 days
Job Retention = 93 days
AutoPrune = yes
}
FileSet {
Name = "file-set-test0.domain.local"
Include {
Options {
signature = SHA1
compression = GZIP
recurse = yes
noatime = yes
hardlinks = yes
}
File = "/etc"
File = "/home"
File = "/var/www"
}
Exclude {
File = "/proc"
File = "/tmp"
File = "/.journal"
File = "/.fsck"
}
}
Job {
Name = "job-backup-test0.domain.local"
Type = Backup
Rerun Failed Levels = yes
Reschedule On Error = Yes
Reschedule Interval = 50 minutes
Reschedule Times = 10
Client = "client-test0.domain.local"
FileSet = "file-set-test0.domain.local"
Schedule = "WeeklyFullDailyInc"
Maximum Concurrent Jobs = 1
Storage = "sd0.backup.local"
Messages = Standard
Pool = "pool-test0.domain.local"
Priority = 10
Write Bootstrap = "/mnt/storage/bacula/bsr/%n.bsr"
}
# cat /etc/bacula/bacula-fd.conf
Director {
Name = "dir0.backup.local"
Password = "strongPasswordForClient"
}
FileDaemon {
Name = "test0.domain.local"
FDport = 9102
WorkingDirectory = /var/lib/bacula
Pid Directory = /var/run/bacula
Maximum Concurrent Jobs = 20
FDAddress = 0.0.0.0
SDConnectTimeout = 20 minutes
Heartbeat Interval = 30 sec
}
Messages {
Name = Standard
director = dir0.backup.local = all, !skipped, !restored
}
Name = "dir0.backup.local"
Password = "strongPasswordForClient"
}
FileDaemon {
Name = "test0.domain.local"
FDport = 9102
WorkingDirectory = /var/lib/bacula
Pid Directory = /var/run/bacula
Maximum Concurrent Jobs = 20
FDAddress = 0.0.0.0
SDConnectTimeout = 20 minutes
Heartbeat Interval = 30 sec
}
Messages {
Name = Standard
director = dir0.backup.local = all, !skipped, !restored
}
Заставляем сервер Bacula перечитать свои конфигурационные файлы:
# /etc/init.d/bacula-director reload
Перезапускаем клиента:
# /etc/init.d/bacula-fd restart
Подключаемся к консоли сервера Bacula:
# bconsole
Connecting to Director dir0.backup.local
Enter a period to cancel a command.
*
Enter a period to cancel a command.
*
Просматриваем состояние сервера:
*
*status director
....
Scheduled Jobs:
Level Type Pri Scheduled Name Volume
===================================================================================
Incremental Backup 10 02-Jul-10 22:05 job-backup-test0.domain.local *unknown*
....
*
*status director
....
Scheduled Jobs:
Level Type Pri Scheduled Name Volume
===================================================================================
Incremental Backup 10 02-Jul-10 22:05 job-backup-test0.domain.local *unknown*
....
*
Наблюдаем запланированное задание с неопределённым пока "томом" для хранения.
Попробуем принудительно исполнить задание на резервирование данных в консоли Bacula:
*
*run
....
A job name must be specified.
The defined Job resources are:
1: job-backup-test0.domain.local
2: job-restore-test0.domain.local
Select Job resource (1-2): 1
Run Backup job
JobName: job-backup-test0.domain.local
Level: Incremental
Client: client-test0.domain.local
FileSet: file-set-test0.domain.local
Pool: pool-test0.domain.local (From Job resource)
Storage: sd0.backup.local (From Job resource)
OK to run? (yes/mod/no): yes
Job queued. JobId=19
You have messages.
*
*run
....
A job name must be specified.
The defined Job resources are:
1: job-backup-test0.domain.local
2: job-restore-test0.domain.local
Select Job resource (1-2): 1
Run Backup job
JobName: job-backup-test0.domain.local
Level: Incremental
Client: client-test0.domain.local
FileSet: file-set-test0.domain.local
Pool: pool-test0.domain.local (From Job resource)
Storage: sd0.backup.local (From Job resource)
OK to run? (yes/mod/no): yes
Job queued. JobId=19
You have messages.
*
Просмотрим, что нам сообщает Bacula по поводу отданного на исполнение задания:
*
*messages
dir0.backup.local JobId 19: No prior Full backup Job record found.
dir0.backup.local JobId 19: No prior or suitable Full backup found in catalog. Doing FULL backup.
dir0.backup.local JobId 19: Start Backup JobId 19
dir0.backup.local JobId 19: Created new Volume "test0.domain.local-0005" in catalog.
dir0.backup.local JobId 19: Using Device "FileStorage"
sd0.backup.local JobId 19: Labeled new Volume "test0.domain.local-0005" on device "FileStorage" (/mnt/bacula).
sd0.backup.local JobId 19: Wrote label to prelabeled Volume "test0.domain.local-0005" on device "FileStorage" (/mnt/bacula)
sd0.backup.local JobId 19: Job write elapsed time = 00:00:01, Transfer rate = 448.2 K bytes/second
dir0.backup.local JobId 19: Bacula dir0.backup.local
Build OS: i486-pc-linux-gnu debian 5.0
JobId: 19
Job: job-backup-test0.domain.local.2010-07-02_11.30.15.03
Backup Level: Full (upgraded from Incremental)
Client: "client-test0.domain.local"
FileSet: "file-set-test0.domain.local"
Pool: "pool-test0.domain.local" (From Job resource)
Storage: "sd0.backup.local" (From Job resource)
Scheduled time: 02-Jul-2010 11:30:04
Start time: 02-Jul-2010 11:30:17
End time: 02-Jul-2010 11:30:18
Elapsed time: 1 sec
Priority: 10
FD Files Written: 762
SD Files Written: 762
FD Bytes Written: 366,888 (366.8 KB)
SD Bytes Written: 448,269 (448.2 KB)
Rate: 366.9 KB/s
Software Compression: 66.8 %
VSS: no
Storage Encryption: no
Volume name(s): test0.domain.local-0005
Volume Session Id: 2
Volume Session Time: 1278043476
Last Volume Bytes: 467,830 (467.8 KB)
Non-fatal FD errors: 0
SD Errors: 0
FD termination status: OK
SD termination status: OK
Termination: Backup OK
dir0.backup.local JobId 19: Begin pruning Jobs.
dir0.backup.local JobId 19: No Jobs found to prune.
dir0.backup.local JobId 19: Begin pruning Files.
dir0.backup.local JobId 19: No Files found to prune.
dir0.backup.local JobId 19: End auto prune.
*
*messages
dir0.backup.local JobId 19: No prior Full backup Job record found.
dir0.backup.local JobId 19: No prior or suitable Full backup found in catalog. Doing FULL backup.
dir0.backup.local JobId 19: Start Backup JobId 19
dir0.backup.local JobId 19: Created new Volume "test0.domain.local-0005" in catalog.
dir0.backup.local JobId 19: Using Device "FileStorage"
sd0.backup.local JobId 19: Labeled new Volume "test0.domain.local-0005" on device "FileStorage" (/mnt/bacula).
sd0.backup.local JobId 19: Wrote label to prelabeled Volume "test0.domain.local-0005" on device "FileStorage" (/mnt/bacula)
sd0.backup.local JobId 19: Job write elapsed time = 00:00:01, Transfer rate = 448.2 K bytes/second
dir0.backup.local JobId 19: Bacula dir0.backup.local
Build OS: i486-pc-linux-gnu debian 5.0
JobId: 19
Job: job-backup-test0.domain.local.2010-07-02_11.30.15.03
Backup Level: Full (upgraded from Incremental)
Client: "client-test0.domain.local"
FileSet: "file-set-test0.domain.local"
Pool: "pool-test0.domain.local" (From Job resource)
Storage: "sd0.backup.local" (From Job resource)
Scheduled time: 02-Jul-2010 11:30:04
Start time: 02-Jul-2010 11:30:17
End time: 02-Jul-2010 11:30:18
Elapsed time: 1 sec
Priority: 10
FD Files Written: 762
SD Files Written: 762
FD Bytes Written: 366,888 (366.8 KB)
SD Bytes Written: 448,269 (448.2 KB)
Rate: 366.9 KB/s
Software Compression: 66.8 %
VSS: no
Storage Encryption: no
Volume name(s): test0.domain.local-0005
Volume Session Id: 2
Volume Session Time: 1278043476
Last Volume Bytes: 467,830 (467.8 KB)
Non-fatal FD errors: 0
SD Errors: 0
FD termination status: OK
SD termination status: OK
Termination: Backup OK
dir0.backup.local JobId 19: Begin pruning Jobs.
dir0.backup.local JobId 19: No Jobs found to prune.
dir0.backup.local JobId 19: Begin pruning Files.
dir0.backup.local JobId 19: No Files found to prune.
dir0.backup.local JobId 19: End auto prune.
*
Вывод подробный и весьма положительный. Наше первое задание на резервирование успешно завершено.
Если мы вновь просмотрим состояние "Директора" Bacula, то сможем увидеть изменения в состоянии нашего задания на резервирование - для него был создан в автоматическом режиме "том" хранения:
*
*status director
....
Scheduled Jobs:
Level Type Pri Scheduled Name Volume
===================================================================================
Incremental Backup 10 02-Jul-10 22:05 job-backup-test0.domain.local test0.domain.local-0005
....
*
*status director
....
Scheduled Jobs:
Level Type Pri Scheduled Name Volume
===================================================================================
Incremental Backup 10 02-Jul-10 22:05 job-backup-test0.domain.local test0.domain.local-0005
....
*
Просмотр состояния клиентов покажет нам таблицу результатов резервного копирования (в нашем случае первое из низ было полным, а второе, заданное той же командой, что и первое, уже инкрементальным):
*
*status client
....
Terminated Jobs:
JobId Level Files Bytes Status Finished Name
======================================================================
19 Full 762 366.8 K OK 02-Jul-10 11:30 job-backup-test0.domain.local.2010-07-02_11
20 Incr 3 186 OK 02-Jul-10 11:37 job-backup-test0.domain.local.2010-07-02_11
....
*
*status client
....
Terminated Jobs:
JobId Level Files Bytes Status Finished Name
======================================================================
19 Full 762 366.8 K OK 02-Jul-10 11:30 job-backup-test0.domain.local.2010-07-02_11
20 Incr 3 186 OK 02-Jul-10 11:37 job-backup-test0.domain.local.2010-07-02_11
....
*
В этой шпаргалке я не описал методику создания и отработки задания восстановления файлов из резерынй копий, вынеся это в отдельную заметку здесь.