====== BareOS ======
===== 1 Instalace =====
==== 1.1 Server ====
pomocny skript, kde se instaluje jako DB postgresql (je nutne ji mit dopredu nainstalovanou):
#
# distribuce
DIST=Debian_9.0
# release bareosu
RELEASE=release/latest/
URL=http://download.bareos.org/bareos/$RELEASE/$DIST
# add the Bareos repository
printf "deb $URL /\n" > /etc/apt/sources.list.d/bareos.list
# add package key
wget -q $URL/Release.key -O- | apt-key add -
# install Bareos packages
apt update
apt install bareos bareos-database-postgresql bareos-webui
* DB se nastavuje pres dbconfig-common
* pustime sluzby
service bareos-dir start
service bareos-sd start
service bareos-fd start
==== 1.2 Klient ====
pro debian 9 a latest bareos
printf "deb http://download.bareos.org/bareos/release/latest/Debian_9.0 /\n" > /etc/apt/sources.list.d/bareos.list
wget -q http://download.bareos.org/bareos/release/latest/Debian_9.0/Release.key -O- | apt-key add -
apt update && apt install bareos-filedaemon
===== 2 Konfigurace =====
==== 2.1 Server ====
bconsole
Server musi znat FDQN klienta, nejjednodussi pridat do hosts?
=== 2.1.1 webui ===
adresa je http://HOSTNAME/bareos-webui
nano /etc/bareos/bareos-dir.d/console/admin.conf
obsah
Console {
Name = "admin"
Password = "secret"
Profile = "webui-admin"
}
* musi mit uzivatele
bconsole
configure add console name=admin password=secret profile=webui-admin
=== 2.1.2 storage ===
* pro lokalni storage editujeme
nano /etc/bareos/bareos-sd.d/storage/bareos-sd.conf
* proste prvni pepiseme, druhe zkopirujeme a pojmenujeme jinak
* musi mit moznost zapisovat user bareos, grupa bareos
* zkopirujeme to, co nam bareos uz nasral do puvodniho umisteni
* editujeme tak, abychom pridali novou storage
nano /etc/bareos/bareos-dir.d/storage/File.conf
* po restartu sd, fd, a dir bychom meli videt vysledek ve webui
=== 2.1.3 shedule -SH ===
kazda shedule ma svuj .conf
nano /etc/bareos/bareos-dir.d/schedule/Pulnocni.conf
s obsahem napr
Schedule {
# name (required)
Name = "Pulnocni-SH"
# this will run once a day, every day at 21:10
Run = daily at 01:10
}
viz manual
chown bareos.bareos Pulnocni.conf
=== 2.1.4 fileset -FS ===
i kazdy fileset ma conf
nano /etc/bareos/bareos-dir.d/fileset/OPi.conf
s obsahem napr
FileSet {
# name (required)
Name = "OPi-FS"
# include directory
Include {
Options {
# calculate a signature for all files
# both MD5/SHA1 are available, this is definitly for long term storage
# a good idea to activate, note that the hash ads a bit of storage overhead
Signature = MD5
# compress every file with compression software
# best known are : LZ4/GZIP (see manual for the others)
# LZ4 is super fast in both compression and decompression
Compression = LZ4
# if supported by the OS, the read time won't be adapted
# this would generate a bunch of writes for no reason on the client machine.
noatime = yes
}
# the directory we are including
# note: no trailing slashes!
File = /etc /usr /var /root /home
}
}
nezapomenout
chown bareos.bareos OPi.conf
=== 2.1.5 jobdefs -JD ===
udelame conf, kde stanovujeme druh zalohy, priradime shedule...
nano /etc/bareos/bareos-dir.d/jobdefs/smarthome.conf
a naplnime napr
JobDefs {
# name (required)
Name = "SmartHome-JD"
# type can be backup/restore/verify
Type = Backup
# the default level bareos will try
# can also be Full/Differential(since last full)/Incremental(since last incremental)
Level = Incremental
# the default client, to be overwritten by the job.conf
Client = bareos-fd
# what files to include/exclude
FileSet = "OPi-FS"
# the schedule we just created
Schedule = "Pulnocni-SH"
# where to store it
Storage = File
# the message reporting
Messages = Standard
# the pool where to store it
Pool = Incremental
# the higher the value priority the lower it will be dropped in the queue
# so for important jobs priority=1 will run first
Priority = 10
# the bootstrap file keeps a "log" of all the backups, and gets rewritten every time a
# full backup is made, it can be used during recovery
Write Bootstrap = "/var/lib/bareos/%c.bsr"
# in case these value's get overwritten
# define where would be a good pool to write
# note that full backup will be used atleast once because no full
# backup will exist
Full Backup Pool = Full
Differential Backup Pool = Differential
Incremental Backup Pool = Incremental
}
zase nezapomeneme na chown
=== 2.1.6 job -JOB ===
vytvorime
nano /etc/bareos/bareos-dir.d/job/opi.conf
a naplnime
Job {
# required
Name = "OPi-JOB"
# the default settings
JobDefs = "SmartHome-JD"
# overwrite the client here
Client = "SEM JMENO KLIENTA"
}
==== 2.2 Klient ====
na serveru bconsole
configure add client name=jmenomasiny address=192.168.0.2 password=SOME_PASSWORD
to vygeneruje
/etc/bareos/bareos-dir-export/client/.../bareos-fd.d/director/bareos-dir.conf
coz zkopirujeme na klienta do
/etc/bareos/bareos-fd.d/director/
restartneme fd na klientovi klient musi znat FDQN serveru a naopak, pridame do hosta (nejjednodussi)