четверг, 10 декабря 2009 г.

Репозиторий с собранной бакулой для CentOS

[pp-contrib]
name=PPs packages for Red Hat Enterprise Linux 5 - contrib
baseurl=ftp://ftp.pramberger.at/systems/linux/contrib/rhel5/$basearch/
gpgcheck=1
gpgkey=ftp://ftp.pramberger.at/systems/linux/contrib/rhel5/RPM-GPG-KEY-6971f6ac
enabled=1
priority=30

[pp-contrib-debug]
name=PPs packages for Red Hat Enterprise Linux 5 - debug
baseurl=ftp://ftp.pramberger.at/systems/linux/contrib/rhel5/$basearch/debug/
gpgcheck=1
gpgkey=ftp://ftp.pramberger.at/systems/linux/contrib/rhel5/RPM-GPG-KEY-6971f6ac
enabled=0
priority=30

[pp-contrib-source]
name=PPs packages for Red Hat Enterprise Linux 5 - source
baseurl=ftp://ftp.pramberger.at/systems/linux/contrib/rhel5/SRPMS/
gpgcheck=1
gpgkey=ftp://ftp.pramberger.at/systems/linux/contrib/rhel5/RPM-GPG-KEY-6971f6ac
enabled=0
priority=30

Bacula, шаблон для вставки в конфиг стораж демона

Device {
 Name = @compname@-FileStorage
 Device Type = File
 Media Type = @compname@-File
 Archive Device = /bacula/devices/@compname@
 Random Access = Yes
 AutomaticMount = yes
 RemovableMedia = no
 AlwaysOpen = no
 LabelMedia = yes
}

Bacula, шаблон для вставки в конфиг директора

# @compname@ dir
# Client (File Services) to backup
Job {
 Name = "@compname@-job"
 JobDefs = "DefaultJob2"
 Write Bootstrap = "/var/lib/bacula/@compname@.bsr"
 Client = @compname@-fd
 FileSet = "@compname@-FileSet"
 Storage = "@compname@-FileStorage"
 ClientRunBeforeJob = "\"E:/Documents and Settings/All Users/Application Data/Bacula/runbefore.bat\""
 ClientRunAfterJob = "\"E:/Documents and Settings/All Users/Application Data/Bacula/runafter.bat\""
}

Client {
 Name = @compname@-fd
 Maximum Concurrent Jobs = 20
 Address = @compname@.local
 FDPort = 9102
 Catalog = MyCatalog
 Password = "passworrd"          # password for FileDaemon
 File Retention = 60 days            # 30 days
 Job Retention = 6 months            # six months
 AutoPrune = yes                     # Prune expired Jobs/Files
}

# List of files to be backed up
FileSet {
 Name = "@compname@-FileSet"
 Enable VSS = yes
 Include {
   Options {
     signature = MD5
     compression = GZIP
     IgnoreCase = yes
     Exclude = yes
     WildDir = "[A-Z]:/temp"
     WildFile = "*.tmp"
     WildDir = "[A-Z]:/RECYCLER"
     WildFile = "[A-Z]:/pagefile.sys"
     WildFile = "[A-Z]:/Documents and Settings/*/LocalSettings/Application Data/Microsoft/Windows/usrclass.*"
     WildFile = "[A-Z]:/Documents and Settings/*/ntuser.*"
     WildDir = "[A-Z]:/Documents and Settings/*/Cookies"
     WildDir = "[A-Z]:/Documents and Settings/*/Recent"
     WildDir = "[A-Z]:/Documents and Settings/*/LocalSettings/History"
     WildDir = "[A-Z]:/Documents and Settings/*/LocalSettings/Temp"
     WildDir = "[A-Z]:/Documents and Settings/*/LocalSettings/Temporary Internet Files"
     # These are always open and unable to be backed up
     WildFile = "[A-Z]:/Documents and Settings/All Users/ApplicationData/Microsoft/Network/Downloader/qmgr[01].dat"
     WildFile = "*.mp1"
     WildFile = "*.mp2"
     WildFile = "*.mp3"
     WildFile = "*.avi"
     WildFile = "*.mpg"
     WildFile = "*.mpeg"
     WildFile = "*.ogg"
   }
   File = C:/SystemStateBackup.bkf
   File = E:/

 }
 Exclude {
 }
}

# Definition of file storage device
Storage {
 Name = @compname@-FileStorage
 Maximum Concurrent Jobs = 1
 Address = at0038.local                # N.B. Use a fully qualified name here
 SDPort = 9103
 Password = "passworrd"
 Device = @compname@-FileStorage
 Media Type = @compname@-File
}

Bacula, конфиг файд демона

Director {
 Name = at0038-dir
 Password = "passworrd"
}

Director {
 Name = at0038-mon
 Password = "passworrd"
 Monitor = yes
}

FileDaemon {                          # this is me
 Name = at0038-fd
 FDport = 9102                  # where we listen for the director
 WorkingDirectory = /var/lib/bacula
 Pid Directory = /var/run
 Maximum Concurrent Jobs = 100
}

Messages {
 Name = Standard
 director = at0038-dir = all, !skipped, !restored
}

Bacula, конфиг стораждемона

Storage {                             # definition of myself
 Name = at0038-sd
 SDPort = 9103
 WorkingDirectory = "/var/lib/bacula"
 Pid Directory = "/var/run"
 Maximum Concurrent Jobs = 20
}

Director {
 Name = at0038-dir
 Password = "passworrd"
}

Director {
 Name = at0038-mon
 Password = "passworrd"
 Monitor = yes
}

Device {
 Name = FileStorage
 Media Type = File
 Archive Device = /bacula/devices/default
 LabelMedia = yes
 Random Access = Yes
 AutomaticMount = yes
 RemovableMedia = no
 AlwaysOpen = no
}

Messages {
 Name = Standard
 director = at0038-dir = all
}

@/etc/bacula/conf.d/at0036-sd.conf
@/etc/bacula/conf.d/at0038-sd.conf
@/etc/bacula/conf.d/at0089-sd.conf
@/etc/bacula/conf.d/at-inf-sd.conf
@/etc/bacula/conf.d/at-main-sd.conf
@/etc/bacula/conf.d/at-tkp-sd.conf
@/etc/bacula/conf.d/at-stack1-sd.conf
@/etc/bacula/conf.d/atrec-sd.conf
@/etc/bacula/conf.d/vm-av-sd.conf
@/etc/bacula/conf.d/vm-bc-sd.conf
@/etc/bacula/conf.d/vm-dc-sd.conf
@/etc/bacula/conf.d/vm-fs-sd.conf
@/etc/bacula/conf.d/vm-ftp-sd.conf
@/etc/bacula/conf.d/vm-netpromoter-sd.conf
@/etc/bacula/conf.d/vm-netxms-sd.conf
@/etc/bacula/conf.d/vm-ns1-sd.conf
@/etc/bacula/conf.d/vm-ora-sd.conf
@/etc/bacula/conf.d/vm-proxy-sd.conf
@/etc/bacula/conf.d/vm-ras-sd.conf
@/etc/bacula/conf.d/vm-rt-sd.conf
@/etc/bacula/conf.d/vm-site-sd.conf
@/etc/bacula/conf.d/vm-smtp-sd.conf
@/etc/bacula/conf.d/vm-syslog-sd.conf
@/etc/bacula/conf.d/vm-ts-sd.conf
@/etc/bacula/conf.d/vm-ts2-sd.conf
@/etc/bacula/conf.d/vm-wsus-sd.conf
@/etc/bacula/conf.d/vm-www4-sd.conf
@/etc/bacula/conf.d/vm-www5-sd.conf

Bacula, конфиг директора

Director {
 Name = at0038-dir
 DIRport = 9101
 QueryFile = "/etc/bacula/scripts/query.sql"
 WorkingDirectory = "/var/lib/bacula"
 PidDirectory = "/var/run"
 Maximum Concurrent Jobs = 20
 Password = "passworrd"
 Messages = Daemon
}

Console {
 Name = at0038-mon
 Password = "passworrd"
 CommandACL = status, .status
}

# Generic catalog service
Catalog {
 Name = MyCatalog
 dbname = "bacula"; dbuser = "bacula"; dbpassword = "passworrd"
}

JobDefs {
 Name = "DefaultJob"
 Maximum Concurrent Jobs = 20
 Type = Backup
 Level = Incremental
 Schedule = "WeeklyCycle"
 Messages = Standard
 Pool = Default
 Priority = 10
}

JobDefs {
 Name = "DefaultJob2"
 Maximum Concurrent Jobs = 20
 Type = Backup
 Level = Incremental
 Schedule = "WeeklyCycle2"
 Messages = Standard
 Pool = inc-pool
 Priority = 10
}

JobDefs {
 Name = "DefaultJob3"
 Maximum Concurrent Jobs = 20
 Type = Backup
 Level = Incremental
 Schedule = "WeeklyCycle3"
 Messages = Standard
 Pool = inc-pool
 Priority = 10
}

Job {
 Name = "RestoreFiles"
 Type = Restore
 Client= at0038-fd
 FileSet="at0038-FileSet"
 Storage = FileStorage
 Pool = Default
 Messages = Standard
 Where = /bacula/restores
 Priority = 11
 Maximum Concurrent Jobs = 20
}

Schedule {
 Name = "WeeklyCycle"
 Run = FullPool=fullbackup-pool Level=Full Pool=fullbackup-pool 1st fri at 23:05
 Run = DifferentialPool=diffbackup-pool Level=Differential Pool=diffbackup-pool 2nd-5th fri at 23:05
 Run = IncrementalPool=incbackup-pool Level=Incremental Pool=incbackup-pool sat,sun,mon,tue,wed,thu at 23:05
}

Schedule {
 Name = "WeeklyCycle2"
 Run = FullPool=full-pool Level=Full Pool=full-pool 1st fri at 23:05
 Run = DifferentialPool=diff-pool Level=Differential Pool=diff-pool 2nd-5th fri at 23:05
 Run = IncrementalPool=inc-pool Level=Incremental Pool=inc-pool sat,sun,mon,tue,wed,thu at 23:05
}

Schedule {
 Name = "WeeklyCycle3"
 Run = FullPool=full-pool Level=Full Pool=full-pool 1st fri at 21:05
 Run = DifferentialPool=diff-pool Level=Differential Pool=diff-pool 2nd-5th fri at 21:05
 Run = IncrementalPool=inc-pool Level=Incremental Pool=inc-pool sat,sun,mon,tue,wed,thu at 21:05
}

Schedule {
 Name = "WeeklyCycleAfterBackup"
 Run = Full sun-sat at 23:10
}

Storage {
 Name = FileStorage
 Maximum Concurrent Jobs = 1
 Address = at0038.local
 SDPort = 9103
 Password = "passworrd"
 Device = FileStorage
 Media Type = File
}

Messages {
 Name = Standard
 operatorcommand = "/usr/bin/bsmtp -h localhost -f bacula@at0038.local -s \"Bacula: Intervention needed for %j\" %r"
 mailcommand = "/usr/bin/bsmtp -8 -h localhost -f bacula@at0038.local -r it@mydomain.local -s \"%c %n %l %t: %e\" %r"
 mail = logwatch@mydomain.local = all, !skipped
 operator = logwatch@mydomain.local = mount
 console = all, !skipped, !saved
 append = "/var/log/bacula/bacula.log" = all, !skipped
}

Messages {
 Name = Daemon
 mailcommand = "/usr/bin/bsmtp -h localhost -f bacula@at0038.local -s \"Bacula daemon message\" %r"
 mail = logwatch@mydomain.local = all, !skipped
 console = all, !skipped, !saved
 append = "/var/log/bacula/bacula.log" = all, !skipped
}

Pool {
 Name = Default
 Pool Type = Backup
 Recycle = yes                       # Bacula can automatically recycle Volumes
 AutoPrune = yes                     # Prune expired volumes
 Volume Retention = 365 days         # one year
 Label Format = "default-${Year}${Month:p/2/0/r}${Day:p/2/0/r}-${Hour:p/2/0/r}${Minute:p/2/0/r}"
}

Pool {
 Name = Scratch
 Pool Type = Backup
}

Pool {
   Name = fullbackup-pool
   Pool Type = Backup
   Volume Retention = 200 days
   AutoPrune = yes
   Label Format = "fullbackup-${Job}-${Year}${Month:p/2/0/r}${Day:p/2/0/r}-${Hour:p/2/0/r}${Minute:p/2/0/r}${Second:p/2/0/r}"
   Use Volume Once = Yes
}

Pool {
   Name = diffbackup-pool
   Pool Type = Backup
   Volume Retention = 28 days
   AutoPrune = yes
   Label Format = "diffbackup-${Job}-${Year}${Month:p/2/0/r}${Day:p/2/0/r}-${Hour:p/2/0/r}${Minute:p/2/0/r}${Second:p/2/0/r}"
}

Pool {
   Name = incbackup-pool
   Pool Type = Backup
   Volume Use Duration = 6 days
   Volume Retention = 7 days
   AutoPrune = yes
   Label Format = "incbackup-${Job}-${Year}${Month:p/2/0/r}${Day:p/2/0/r}-${Hour:p/2/0/r}${Minute:p/2/0/r}${Second:p/2/0/r}"
}

Pool {
   Name = full-pool
   Pool Type = Backup
   Volume Retention = 200 days
   AutoPrune = yes
   Label Format = "${Job}-full-${Year}${Month:p/2/0/r}${Day:p/2/0/r}-${Hour:p/2/0/r}${Minute:p/2/0/r}${Second:p/2/0/r}"
   Use Volume Once = Yes
}

Pool {
   Name = diff-pool
   Pool Type = Backup
   Volume Retention = 28 days
   AutoPrune = yes
   Label Format = "${Job}-diff-${Year}${Month:p/2/0/r}${Day:p/2/0/r}-${Hour:p/2/0/r}${Minute:p/2/0/r}${Second:p/2/0/r}"
   Use Volume Once = Yes
}

Pool {
   Name = inc-pool
   Pool Type = Backup
   Volume Use Duration = 6 days
   Volume Retention = 7 days
   AutoPrune = yes
   Label Format = "${Job}-inc-${Year}${Month:p/2/0/r}${Day:p/2/0/r}-${Hour:p/2/0/r}${Minute:p/2/0/r}${Second:p/2/0/r}"
   Use Volume Once = Yes
}

@/etc/bacula/conf.d/at0036-dir.conf
@/etc/bacula/conf.d/at0038-dir.conf
@/etc/bacula/conf.d/at0089-dir.conf
@/etc/bacula/conf.d/at-inf-dir.conf
@/etc/bacula/conf.d/at-main-dir.conf
@/etc/bacula/conf.d/atrec-dir.conf
@/etc/bacula/conf.d/at-stack1-dir.conf
# @/etc/bacula/conf.d/at-tkp-dir.conf
@/etc/bacula/conf.d/vm-av-dir.conf
@/etc/bacula/conf.d/vm-bc-dir.conf
@/etc/bacula/conf.d/vm-dc-dir.conf
@/etc/bacula/conf.d/vm-fs-dir.conf
@/etc/bacula/conf.d/vm-ftp-dir.conf
# @/etc/bacula/conf.d/vm-netpromoter-dir.conf
# @/etc/bacula/conf.d/vm-netxms-dir.conf
@/etc/bacula/conf.d/vm-ns1-dir.conf
@/etc/bacula/conf.d/vm-ora-dir.conf
@/etc/bacula/conf.d/vm-proxy-dir.conf
@/etc/bacula/conf.d/vm-ras-dir.conf
@/etc/bacula/conf.d/vm-rt-dir.conf
@/etc/bacula/conf.d/vm-site-dir.conf
@/etc/bacula/conf.d/vm-smtp-dir.conf
@/etc/bacula/conf.d/vm-syslog-dir.conf
@/etc/bacula/conf.d/vm-ts-dir.conf
@/etc/bacula/conf.d/vm-ts2-dir.conf
@/etc/bacula/conf.d/vm-wsus-dir.conf
@/etc/bacula/conf.d/vm-www4-dir.conf
@/etc/bacula/conf.d/vm-www5-dir.conf

четверг, 8 октября 2009 г.

Удаляем старые резервные копии

Смысл: Скопились файлы с резервными копиями, информация о которых отсутсвует в каталоге Baculы. Надо бы от них избавиться.
Что делать? Надо узнать если информация в каталоге бакулы по каждому файлу в папках устройств.
Скрипт:
#!/bin/bash
devicesdir=/bacula/devices
medianame=''
result=''
mysql_host="localhost"
mysql_db="bacula"
mysql_user="bacula"
mysql_password=""

for myfile in $devicesdir/*/*
do
medianame=`echo "$myfile" | cut -d'/' -f5`
result=`echo "select VolumeName FROM Media WHERE VolumeName=\"$medianame\";" | mysql -h $mysql_host -u $mysql_user -p$mysql_password $mysql_db`
if [ "$result" = "" ]
then
rm -fv $myfile
fi
done

В итоге скрипт удалит все файлы, информация о которых не нашлась в каталоге.

Использовать крайне осторожно! Можно лишиться своих резервных копий.

вторник, 21 июля 2009 г.

Автомобильная аптечка

1. Обезболивающие, противовоспалительные и противо шоковые средства при травме (ушибы, переломы, вывихи), ранениях, шоке.
1.1. Анальгин 0,5 № 10 (или аналог) 1 уп.
аспирин 0,5 № 10 1 уп.
1.2. Портативный гипотермический (охлаждающий) пакет-контейнер 1 шт.
1.3. Раствор сульфацила натрия 1 фл.

2. Средства для остановки кровотечения, обработки и перевязки ран.
2.1. Жгут для остановки артериального кровотечения с дозированной компрессией (сдавливанием) для само- и взаимопомощи 1 шт.
2.2. Бинт стерильный 10Ч5 1 шт.
2.3. Бинт нестерильный 10Ч5 1 шт.
2.4. Бинт нестерильный 5Ч5 1 шт.
2.5. Атравматическая повязка МАГ с диоксидином или нитратом серебра 8Ч10 для перевязки грязных ран 1 шт.
2.6. Лейкопластырь бактерицидный 2,5Ч7,2 или 2Ч5 8 шт.
2.7. Салфетки стерильные для остановки капиллярного и венозного кровотечения «Колетекс ГЕМ» с фурагином 6Ч10 см, 10Ч18 см 3 шт. или Статин (порошок) 1,0 гр 3 уп.
2.8. Раствор йода спиртовой 5% или бриллиантовой зелени 1% 1 фл.
2.9. Лейкопластырь 1Ч500 или 2Ч500 или 1Ч250 1 шт.
2.10. Бинт эластичный трубчатый медицинский нестерильный № 1, 3, 6 по 1 шт
2.11. Вата 50 г 1 шт.

3. Средства при болях в сердце.
3.1. Нитроглицерин таб. № 40 или капс. № 20 (тринитролонг) 1 уп.
3.2. Валидол таб. или капс. 1 уп.

4. Средства для сердечно-легочной реанимации при клинической смерти.
4.1. Устройство для проведения искусственного дыхания «Рот-в-рот» 1 шт.

5. Средство при обмороке (коллапсе).
5.1. Аммиака раствор (нашатырный спирт) 1 фл.

6. Средство для дезинтоксикации при отравлениях пищей и т.д.
6.1. Энтеродеа 2 уп.
или уголь активированный в табл. № 10 1 уп.

7. Средство при стрессовых реакциях.
7.1. Корвалол 1 фл.

8. Ножницы тупоконечные 1 шт.

9. Инструкция

10. Футляр пластмассовый

понедельник, 6 апреля 2009 г.

Правим UDEV для DV камеры

В файле /lib/udev/rules.d/50-udev-default.rules

Правим:
# KERNEL=="dv1394[0-9]*", NAME="dv1394/%n", GROUP="video"
KERNEL=="video1394[0-9]*", NAME="video1394/%n", GROUP="video"
KERNEL=="dv1394*", GROUP="video"
KERNEL=="raw1394", GROUP="plugdev"

среда, 1 апреля 2009 г.

Установка bacula

Журнал, backup сервер, установка и настройка
hostname нашего сервера: at0038

У меня контроллер на 8 дисков, по 500 гБ каждый
Делаем два RAID массива, system - 60 GB, data - 2700 GB
Это необходимо, из-за того, что CentOS не может установиться на раздел больше чем 2 ТБ.
sda1 - 10 gb / (корневой раздел оставляем не на ЛВМ)
sda2 - 50 gb pv
sdb1 - 2,6 tb pv
vg0 - /dev/sda2 (Один волумгруп для системных разделов)
vg1 - /dev/sdb1 (один волум групп для данных)
vg0/lv_swap - 2 gb - swap
vg0/lv_var - 10 gb - /var
vg0/lv_tmp - 10 gb - /tmp
vg0/lv_usr - 10 gb - /usr
vg1/lv_bacula - 2,6 tb - /bacula

Centos 5.2 - Установка поумолчанию.
Обновляемся после установки.

Качаем свежую сборку bacula rpms-contrib-fschwarz
Устанавливаем:
качаем ключ: wget http://freefr.dl.sourceforge.net/sourceforge/bacula/fschwarz.asc
устанавливаем ключ: rpm --import fschwarz.asc
yum --nogpgcheck install bacula-mysql-2.4.2-1.el5.i386.rpm bacula-bat-2.4.2-1.el5.i386.rpm bacula-gconsole-2.4.2-1.el5.i386.rpm
правим /etc/aliases:
root: тут адрес на который должны приходить инормационные письма
# newaliases
# /etc/init.d/sendmail restart
Настройка Bacula

Читать:
http://www.opennet.ru/soft/Short_Doc_Bacula.pdf
http://santa-claus-rpm.livejournal.com/5066.html
http://www.opennet.ru/soft/Bacula_PDC_backup.pdf
http://wiki.bacula.org/doku.php
http://www.bog.pp.ru/work/bacula.html

В папке /bacula/devices - создаю папки для каждого клиента, каждая папка устройство (device), бакула не может писать два задания на одно устройство одновременно, если хотим чтобы копирование происходило с нескольких клиентов одновременно, тогда нужно создать несколько устройств.

Конфигурационные файлы:

bacula-dir.conf:

Director {
Name = at0038-dir
DIRport = 9101
QueryFile = "/usr/lib/bacula/query.sql"
WorkingDirectory = "/var/lib/bacula"
PidDirectory = "/var/run"
Maximum Concurrent Jobs = 10
Password = "12345"
Messages = Daemon
}

Console {
Name = at0038-mon
Password = "12345"
CommandACL = status, .status
}

# Generic catalog service
Catalog {
Name = MyCatalog
dbname = "bacula"; dbuser = "bacula"; dbpassword = ""
}

JobDefs {
Name = "DefaultJob"
Maximum Concurrent Jobs = 20
Type = Backup
Level = Incremental
Schedule = "WeeklyCycle"
Messages = Standard
Pool = Default
Priority = 10

}

Job {
Name = "RestoreFiles"
Type = Restore
Client= at0038-fd
FileSet="at0038-FileSet"
Storage = FileStorage
Pool = Default
Messages = Standard
Where = /bacula/restores
Priority = 11
Maximum Concurrent Jobs = 100
}

Schedule {
Name = "WeeklyCycle"
Run = FullPool=fullbackup-pool Level=Full Pool=fullbackup-pool 1st fri at 23:05
Run = DifferentialPool=diffbackup-pool Level=Differential Pool=diffbackup-pool 2nd-5th fri at 23:05
Run = IncrementalPool=incbackup-pool Level=Incremental Pool=incbackup-pool sat,sun,mon,tue,wed,thu at 23:05
}

Schedule {
Name = "WeeklyCycleAfterBackup"
Run = Full sun-sat at 23:10
}

Storage {
Name = FileStorage
Maximum Concurrent Jobs = 1
Address = at0038
SDPort = 9103
Password = "12345"
Device = FileStorage
Media Type = File
}


Messages {
Name = Standard
operatorcommand = "/usr/sbin/bsmtp -h localhost -f bacula@at0038 -s \"Bacula: Intervention needed for %j\" %r"
mailcommand = "/usr/sbin/bsmtp -8 -h localhost -f bacula@at0038 -s \"%c %n %l %t: %e\" %r"
mail = root@localhost = all, !skipped
operator = root@localhost = mount
console = all, !skipped, !saved
append = "/var/lib/bacula/log" = all, !skipped
}

Messages {
Name = Daemon
mailcommand = "/usr/sbin/bsmtp -h localhost -f bacula@at0038 -s \"Bacula daemon message\" %r"
mail = root@localhost = all, !skipped
console = all, !skipped, !saved
append = "/var/lib/bacula/log" = all, !skipped
}

Pool {
Name = Default
Pool Type = Backup
Recycle = yes # Bacula can automatically recycle Volumes
AutoPrune = yes # Prune expired volumes
Volume Retention = 365 days # one year
Label Format = "default-${Job}-${Year}${Month:p/2/0/r}${Day:p/2/0/r}-${Hour:p/2/0/r}${Minute:p/2/0/r}"
}

Pool {
Name = Scratch
Pool Type = Backup
}

Pool {
Name = fullbackup-pool
Pool Type = Backup
Volume Retention = 200 days
AutoPrune = yes
RecyclePool = Scratch
Recycle = yes
Recycle Oldest Volume = yes
Label Format = "fullbackup-${Job}-${Year}${Month:p/2/0/r}${Day:p/2/0/r}-${Hour:p/2/0/r}${Minute:p/2/0/r}${Second:p/2/0/r}"
Use Volume Once = Yes
}

Pool {
Name = diffbackup-pool
Pool Type = Backup
Volume Retention = 40 days
AutoPrune = yes
RecyclePool = Scratch
Recycle = yes
Recycle Oldest Volume = yes
Label Format = "diffbackup-${Job}-${Year}${Month:p/2/0/r}${Day:p/2/0/r}-${Hour:p/2/0/r}${Minute:p/2/0/r}${Second:p/2/0/r}"
Use Volume Once = Yes
}

Pool {
Name = incbackup-pool
Pool Type = Backup
Volume Use Duration = 7 days
Volume Retention = 8 days
AutoPrune = yes
RecyclePool = Scratch
Recycle = yes
Recycle Oldest Volume = yes
Label Format = "incbackup-${Job}-${Year}${Month:p/2/0/r}${Day:p/2/0/r}-${Hour:p/2/0/r}${Minute:p/2/0/r}${Second:p/2/0/r}"
Use Volume Once = Yes
}

@/etc/bacula/conf.d/шаблон для каждого клиента компьютера (имякомпьютера-dir.conf)

bacula-sd.conf:

Storage { # definition of myself
Name = at0038-sd
SDPort = 9103
WorkingDirectory = "/var/lib/bacula"
Pid Directory = "/var/run"
Maximum Concurrent Jobs = 20
}

Director {
Name = at0038-dir
Password = "12345"
}

Director {
Name = at0038-mon
Password = "12345"
Monitor = yes
}

Device {
Name = FileStorage
Media Type = File
Archive Device = /bacula/devices/default
LabelMedia = yes
Random Access = Yes
AutomaticMount = yes
RemovableMedia = no
AlwaysOpen = no
}

Messages {
Name = Standard
director = at0038-dir = all
}

@/etc/bacula/conf.d/шаблон для каждого клиента компьютера (имякомпьютера-sd.conf)

bacula-fd.conf:

Director {
Name = at0038-dir
Password = "12345"
}

Director {
Name = at0038-mon
Password = "12345"
Monitor = yes
}

FileDaemon { # this is me
Name = at0038-fd
FDport = 9102 # where we listen for the director
# WorkingDirectory = "C:\\Documents and Settings\\All Users\\Application Data\\Bacula\\Work"
# Pid Directory = "C:\\Documents and Settings\\All Users\\Application Data\\Bacula\\Work"
WorkingDirectory = /var/lib/bacula
Pid Directory = /var/run
Maximum Concurrent Jobs = 20
}

Messages {
Name = Standard
director = at0038-dir = all, !skipped, !restored
}

bat.conf, bconsole.conf

Director {
Name = at0038-dir
DIRport = 9101
address = at0038
Password = "12345"
}

шаблон-dir.conf:

# %wintemplate% dir
# Client (File Services) to backup
Job {
Name = "%wintemplate%-job"
Maximum Concurrent Jobs = 10
JobDefs = "DefaultJob"
Write Bootstrap = "/var/lib/bacula/%wintemplate%.bsr"
Client = %wintemplate%-fd
FileSet = "%wintemplate%-FileSet"
Storage = "%wintemplate%-FileStorage"
ClientRunBeforeJob = "\"C:\\Documents and Settings\\All Users\\Application Data\\Bacula\\runbefore.bat\""
ClientRunAfterJob = "\"C:\\Documents and Settings\\All Users\\Application Data\\Bacula\\runafter.bat\""
}

Client {
Name = %wintemplate%-fd
Maximum Concurrent Jobs = 10
Address = %wintemplate%
FDPort = 9102
Catalog = MyCatalog
Password = "12345" # password for FileDaemon
File Retention = 60 days # 30 days
Job Retention = 6 months # six months
AutoPrune = yes # Prune expired Jobs/Files
}

# List of files to be backed up
FileSet {
Name = "%wintemplate%-FileSet"
Enable VSS = yes
Include {
Options {
signature = MD5
compression = GZIP
IgnoreCase = yes
Exclude = yes
WildDir = "[A-Z]:/temp"
WildFile = "*.tmp"
WildDir = "[A-Z]:/RECYCLER"
WildFile = "[A-Z]:/pagefile.sys"
WildFile = "*.mp1"
WildFile = "*.mp2"
WildFile = "*.mp3"
WildFile = "*.avi"
WildFile = "*.mpg"
WildFile = "*.mpeg"
WildFile = "*.ogg"
WildFile = "*.cdx"
}
File = C:/SystemStateBackup.bkf
}
Exclude {
}
}

# Definition of file storage device
Storage {
Name = %wintemplate%-FileStorage
Maximum Concurrent Jobs = 10
Address = at0038
SDPort = 9103
Password = "12345"
Device = %wintemplate%-FileStorage
Media Type = %wintemplate%-File
}

шаблон-dir.conf (linux):

# %nixtemplate% dir
# Client (File Services) to backup
Job {
Name = "%nixtmplate%-job"
Maximum Concurrent Jobs = 10
JobDefs = "DefaultJob"
Write Bootstrap = "/var/lib/bacula/at0038.bsr"
Client = at0038-fd
FileSet = "%nixtmplate%-FileSet"
Storage = %nixtmplate%-FileStorage
}

Client {
Name = %nixtmplate%-fd
Maximum Concurrent Jobs = 10
Address = %nixtmplate%
FDPort = 9102
Catalog = MyCatalog
Password = "12345" # password for FileDaemon
File Retention = 60 days # 30 days
Job Retention = 6 months # six months
AutoPrune = yes # Prune expired Jobs/Files
}

# List of files to be backed up
FileSet {
Name = "%nixtmplate%-FileSet"
Include {
Options {
signature = MD5
compression = GZIP
}
File = /home
File = /etc
File = /usr/local
File = /opt
File = /root
File = /var/log
File = /var/run
File = /var/spool
}

Exclude {
File = /proc
File = /tmp
File = /.journal
File = /.fsck
}
}

# Definition of file storage device
Storage {
Name = %nixtmplate%-FileStorage
Maximum Concurrent Jobs = 10
Address = at0038
SDPort = 9103
Password = "12345"
Device = %nixtmplate%-FileStorage
Media Type = %nixtmplate%-File
}

шаблон-sd:

Device {
Name = %template%-FileStorage
Device Type = File
Media Type = %template%-File
Archive Device = /bacula/devices/%template%
Random Access = Yes
AutomaticMount = yes
RemovableMedia = no
AlwaysOpen = no
LabelMedia = yes
}

четверг, 26 февраля 2009 г.

Установка XenServer по сети

Ставим XenServer по сети с помощью WDS (Windows Deploymen Service) или RIS.

Создаем папки:
RemoteInstall\Setup\Russian\Images\xen
RemoteInstall\Setup\Russian\Images\xen\i386
RemoteInstall\Setup\Russian\Images\xen\i386\templates
RemoteInstall\Setup\Russian\Images\xen\i386\templates\pxelinux.cfg
RemoteInstall\Setup\Russian\Images\xen\i386\templates\xenserver

Создаем файл E:\RemoteInstall\Setup\Russian\Images\xen\i386\templates\pxeboot.sif:
[OSChooser]
Description = "Install Citrix XenServer"
Help = "Install Citrix XenServer"
LaunchFile = "Setup\Russian\Images\xen\i386\templates\pxelinux.0"
Version = "1.00"
ImageType=Flat


Файл pxelinux.0 берем из syslinux.
Распаковываем содержимое образа диска в папку RemoteInstall\Setup\Russian\Images\xen\i386\templates\xenserver
Организовываем доступ к этой папке по ftp и\или http (*tp://server/xenserver/)

Создаем файл RemoteInstall\Setup\Russian\Images\xen\i386\templates\pxelinux.cfg\default:
DISPLAY Install XenServer 5.0.0

DEFAULT install

LABEL install
kernel xenserver/boot/isolinux/mboot.c32
append xenserver/boot/xen.gz watchdog com1=115200,8n1i console=com1,tty --- xenserver/boot/vmlinuz root=/dev/ram0 console=tty0 console=ttyS0,115200n8 ramdisk_size=32758 --- xenserver/install.img

PROMPT 1
TIMEOUT 0


Сама установка проходит без проблем, нужно лишь указать способ установки http или ftp, и когда попросят, указать URL *tp://server/xenserver.


знания почерпнул тут

вторник, 10 февраля 2009 г.

Шум шин
Шаровые шарниры
Шипованные шины шумят на шоссе
Саммит антисемитов в ассамблее