⬆️ ⬇️

Backup with Open Source Solution - Bareos





Having a current backup at hand is an extremely important point, because no one is immune from unpleasant incidents associated with the failure of the media, loss of information, accidental deletion, etc. In such situations, the backup will save not only nerves, but also save you from possible financial problems that may arise due to data loss.



Bareos - was selected as a backup system for the following reasons:

')



Task Description



Suppose we have 3 cars. Servers: Bareos, BitrixVm, Windows Server 2012 R2. For example, all this will be within the same network, but Bareos itself, of course, allows you to perform backups if the machine is located outside of it.



Bareos - 172.16.10.10

BitrixVM - 172.16.10.11

Windows Server - 172.16.10.12




Add a repository:



# wget http://download.bareos.org/bareos/release/latest/CentOS_7/bareos.repo -O /etc/yum.repos.d/bareos.repo 




For the server with Bareos, we will use CentOS 7. The usual installation occurs:



 # yum install -y bareos-client bareos-database-tools bareos-filedaemon bareos-database-postgresql bareos bareos-bconsole bareos-database-common bareos-storage bareos-director bareos-common 


PostgreSQL will be used as the database. Installation is also easy:



 # yum install -y postgresql-server postgresql-contrib 


When installing Bareos in / etc / bareos, we have the following list of files and folders, with the exception of the “ssl” directory, we move on to it a little later:



 /bareos-dir.d /bareos-sd.d /ssl bareos-dir.conf bareos-fd.conf bareos-sd.conf bconsole.conf .rndpwd 


After installation, the scripts for working with Bareos will appear in the / usr / lib / bareos / scripts / directory. Thanks to them, we can pre-configure the database (we will create a database, tables, and rights):



 su postgres -c /usr/lib/bareos/scripts/create_bareos_database su postgres -c /usr/lib/bareos/scripts/make_bareos_tables su postgres -c /usr/lib/bareos/scripts/grant_bareos_privileges 


The important point is that the names of our machines must be resolved, if not, we add the appropriate lines in / etc / hosts



 172.16.10.10 bareos-server 172.16.10.10 bareos-fd 172.16.10.11 bitrixvm 172.16.10.12 win-fd 


bareos-server - the server itself, bareos-fd - we will also make a backup of the server itself, i.e. at the same time, it will act as a client, then it will be seen in the configuration, bitrixvm - the client name speaks for itself, win-fd is a client with Windows Server 2012 R2.



The configuration of the server part for BareOS, namely the director, must be performed in the bareos-dir.conf file. The director is responsible for all operations performed.



Of the main guidelines:



Director - description of the director himself,

Storage - the device on which we write backups,

Catalog - contains information on completed jobs, saved files, clients, statuses,

Messages - which messages will be collected and how to deliver them,

Console - configure the console to manage the director,

Client - description of the client from which backup copies will be taken,

Pool - allows you to manage so-called. Volume where data will be written for different types of backups (Full, Incremental, Differential), limit storage periods. Volume, sizes,

FileSet - what backup and additional attributes,

Schedule - schedule

Job - description of the backup task.


From the official documentation, the scheme of interaction between the services:







Contents of bareos-dir.conf file:
Director {

# Mandatory parameter name of director

Name = bareos-server

# Required parameter for request files

QueryFile = "/usr/lib/bareos/scripts/query.sql"

# Number of jobs simultaneously running

Maximum Concurrent Jobs = 10

# Password (often used 20-40 characters, for the test we will limit ourselves to 9 characters)

Password = "zcx @ # $ BGj"

# Specifying which alerts to use (Message directive is described below)

Messages = Standart

# TLS encryption. Will be described below.

# TLS enabled

TLS Enable = yes

TLS Require = yes



TLS Verify Peer = yes

# Allowed CN

TLS Allowed CN = "bareos-server"

TLS Allowed CN = "bitrixvm"

TLS Allowed CN = "win-fd"

# CA certificate location

TLS CA Certificate File = /etc/bareos/ssl/ca-chain.cert.pem

# Location certificate

TLS Certificate = /etc/bareos/ssl/bareos-server.cert.pem

# Key location to the certificate

TLS Key = /etc/bareos/ssl/bareos-server.nopass.key.pem

TLS DH File = /etc/bareos/ssl/dh1024.pem

}



Storage {

Name = bareos-server-sd

# You can specify both by IP and by name; for TLS to work correctly, it is important to specify by # name

Address = bareos-server

Password = "zcx @ # $ BGj"

# Sets the name for the device where the data will be stored. Device parameters are set in the bareos-sd.conf file

Device = bareos-sd

Media Type = File

Port = 9103

TLS Enable = yes

TLS Require = yes

TLS CA Certificate File = /etc/bareos/ssl/ca-chain.cert.pem

TLS Certificate = /etc/bareos/ssl/bareos-server.cert.pem

TLS Key = /etc/bareos/ssl/bareos-server.nopass.key.pem

}



Catalog {

# All parameters for connecting to the database are set

Name = bareos-server

dbdriver = "postgresql"

dbname = "bareos"

dbuser = "bareos"

dbpassword = ""

}



Messages {

# Describes the types of messages that should be sent and recorded in the log

Name = Standart

mail = root @ localhost = all,! skipped,! audit

console = all,! skipped,! saved,! audit

append = "/var/log/bareos/bareos.log" = all,! skipped,! audit

append = "/var/log/bareos/bareos-audit.log" = audit

}



Client {

# Client name for backup

Name = bareos-fd

# Directory name

Catalog = bareos-server

Enabled = yes

# Address set by name

Address = bareos-server

Password = "zcx @ # $ BGj"

Port = 9102

# TLS settings will be described later

TLS Enable = yes

TLS Require = yes

TLS CA Certificate File = /etc/bareos/ssl/ca-chain.cert.pem

TLS Certificate = /etc/bareos/ssl/bareos-server.cert.pem

TLS Key = /etc/bareos/ssl/bareos-server.nopass.key.pem

}



Pool {

# Pool name for full backup

Name = bareos-pool-Full

# Automatically appends a “bareos-client-Full-” view label to the backup file + number #Volume

# For example, the final name of the Volume after the next backup will look like bareos-client- # Full-0009

Label Format = "bareos-client-Full-"

# Pool type. According to the official BareOS documentation, only the type Backup is currently being performed.

Pool Type = Backup

# Volume for full backup stored for 3 months

Volume Retention = 3 months

# after which the directory is cleared of obsolete data

AutoPrune = yes

# Volume is overwritten

Recycle = yes

}



Pool {

# Pool name for incremental backup

Name = bareos-pool-Incremental

Pool Type = Backup

Recycle = yes

Auto Prune = yes

Volume Retention = 10 days

Label Format = "bareos-client-Incremental-"

}



Pool {

# Pool name for differential backup

Name = bareos-pool-Differential

Pool Type = Backup

Recycle = yes

Auto Prune = yes

Volume Retention = 11 days

Label Format = "bareos-client-Differential-"

}



FileSet {

# Set the name for the file set

Name = bareos-fileset

# In Include, we specify which files will be saved. In this case, the / etc folder

Include {

File = "/ etc"

}

}



Schedule {

# Schedule Name

Name = "MonthlyCycle"

# 1 once a week, a full backup is performed

Run = Level = Full mon at 2:00

# During the day, 5 incremental backups every hour

Run = Level = Incremental hourly at 13:00

Run = Level = Incremental hourly at 14:00

Run = Level = Incremental hourly at 15:00

Run = Level = Incremental hourly at 16:00

Run = Level = Incremental hourly at 17:00

}



Job {

# Name for the task

Name = Job-Full

# His type. Maybe Backup or Restore

Type = Backup

# Backup level. Full, Differential or Incremental

Level = Incremental

# What client is running for?

Client = bareos-fd

# Fileset

FileSet = bareos-fileset

# Schedule

Schedule = "MonthlyCycle"

# Name of used storage

Storage = bareos-server-sd

# Alerts

Messages = Standart

# Used pool

Pool = bareos-pool-Full

Full Backup Pool = bareos-pool-Full

Differential Backup Pool = bareos-pool-Differential

Incremental Backup Pool = bareos-pool-Incremental

}



Job {

Name = Job-Full-restore

Type = Restore

Client = bareos-fd

FileSet = "bareos-fileset"

Storage = bareos-server-sd

Pool = bareos-pool-Full

Messages = Standart

# Specifying the path to where all files will get into during recovery

Where = / tmp

}



# Add the two remaining clients as separate configuration files.



 @/etc/bareos/bareos-dir.d/win.conf @/etc/bareos/bareos-dir.d/bitrixvm.conf 


It is important that there is a correspondence between the configurations:





Next, configure Storage in bareos-sd.conf:
Storage {

# Name

Name = bareos-server-sd

# Maximum number of simultaneously running jobs

Maximum Concurrent Jobs = 20

# Address, specify by name

SDAddress = bareos-server

SDPort = 9103

TLS Enable = yes

TLS Require = yes

TLS Verify Peer = no

TLS Allowed CN = "bareos-server"

TLS CA Certificate File = /etc/bareos/ssl/ca-chain.cert.pem

TLS Certificate = /etc/bareos/ssl/bareos-server.cert.pem

TLS Key = /etc/bareos/ssl/bareos-server.nopass.key.pem

}



Director {

# We describe the parameters of the director who can connect to the Storage

Name = bareos-server

Password = "zcx @ # $ BGj"

TLS Enable = yes

TLS Require = yes

TLS Verify Peer = yes

TLS Allowed CN = "bareos-server"

TLS CA Certificate File = /etc/bareos/ssl/ca-chain.cert.pem

TLS Certificate = /etc/bareos/ssl/bareos-server.cert.pem

TLS Key = /etc/bareos/ssl/bareos-server.nopass.key.pem

TLS DH File = /etc/bareos/ssl/dh1024.pem

}



Device {

# We describe the storage device itself

Name = bareos-sd

Media Type = File

# Path to device

Archive Device = / opt / backup

# Allow auto-mark up volumes

LabelMedia = yes

# For simultaneous access while performing multiple tasks

Random Access = yes

# Automatically mount device

AutomaticMount = yes

RemovableMedia = no

AlwaysOpen = no

}



Messages {

Name = Standard

director = bareos-server = all

}



Configure the client bareos-fd.conf:



Director {

# Settings for director connection

Name = bareos-server

Password = "zcx @ # $ BGj"

TLS Enable = yes

TLS Require = yes

TLS Verify Peer = yes

TLS Allowed CN = "bareos-server"

TLS CA Certificate File = /etc/bareos/ssl/ca-chain.cert.pem

TLS Certificate = /etc/bareos/ssl/bareos-server.cert.pem

TLS Key = /etc/bareos/ssl/bareos-server.nopass.key.pem

TLS DH File = /etc/bareos/ssl/dh1024.pem

}



FileDaemon {

# FileDaemon is a synonym for Client

Name = bareos-fd

Maximum Concurrent Jobs = 20

# Disables compatibility with Bacula. In this case, all features of #bareos are included, which are enabled by default.

Compatible = no

TLS Enable = yes

TLS Require = yes

TLS CA Certificate File = /etc/bareos/ssl/ca-chain.cert.pem

TLS Certificate = /etc/bareos/ssl/bareos-server.cert.pem

TLS Key = /etc/bareos/ssl/bareos-server.nopass.key.pem



}



Messages {

Name = Standard

director = bareos-server = all

}



After all the basic settings you need to restart the bareos services:



 systemctl restart bareos-dir systemctl restart bareos-sd systemctl restart bareos-fd 


In case of errors, we look at the state with the command:



 systemctl status bareos-dir.service -l 


Let's proceed to the installation of the bareos client plugin for Windows. You can download here .



Installing the plugin is also easy. From the list of proposed components, we select only two indicated in the screenshot: then we set the name for the client, indicate the parameters of the already existing director:







We prescribe the following data:



Client Name - win-fd

Director Name - bareos-server

Password - zcx @ # $ BGj

Networks Address - bareos-server


The entered settings can always be corrected, the default configuration file is in “C: \ Program Data \ Bareos \ bareos-fd.conf”.



In the hosts file we also specify the IP for the BareOS server so that the name is resolved. On the server side (bareos-server), the config for the client (win-fd) looks like this and is located along the /etc/bareos/bareos-dir.d/win.conf path:



Expand
Client {

Name = win-fd

Address = win-fd

Password = "zcx @ # $ BGj"

TLS Enable = yes

TLS Require = yes

TLS CA Certificate File = /etc/bareos/ssl/ca-chain.cert.pem

TLS Certificate = /etc/bareos/ssl/bareos-server.cert.pem

TLS Key = /etc/bareos/ssl/bareos-server.nopass.key.pem

}



Pool {

Name = win-bareos-pool-Full

Auto Prune = yes

Label Format = "bareos-client-Full-"

Pool Type = Backup

AutoPrune = yes

Recycle = yes

Volume Retention = 3 months

}



Pool {

Name = win-bareos-pool-Differential

Pool Type = Backup

AutoPrune = yes

Recycle = yes

Volume Retention = 11 days

Label Format = "win-bareos-client-Differential-"

}



Pool {

Name = win-bareos-pool-Incremental

Pool Type = Backup

AutoPrune = yes

Recycle = yes

Volume Retention = 10 days

Label Format = "win-bareos-client-Incremental-"

}



FileSet {

Name = bareos-fileset-win

Include {

File = "C: \\ Users \\"

}

}



Job {

Name = Job-win-Full

Type = Backup

Level = Incremental

Client = win-fd

FileSet = bareos-fileset-win

Schedule = "MonthlyCycle"

Storage = bareos-server-sd

Messages = Standart

Pool = win-bareos-pool-Incremental

Full Backup Pool = win-bareos-pool-Full

Differential Backup Pool = win-bareos-pool-Differential

Incremental Backup Pool = bareos-pool-Incremental

}



Job {

Name = Job-win-Full-restore

Type = Restore

Client = win-fd

FileSet = "bareos-fileset-win"

Storage = bareos-server-sd

Pool = win-bareos-pool-Full

Messages = Standart

Where = "C: / tmp"

}



From the FileSet directive we see that for the Job-win-Full task we copy the users folder “C: \ Users” and in the Job-win-Full-restore task we restore it to the folder if necessary “C: \ tmp”.



There is one more client (bitrixvm) for which you need to copy the root directory and copy the mysql database in a separate task.



Let’s go to the bitrixvm machine and install the client:

yum install -y bareos-client bareos-common



Moving to the / etc / bareos directory



 /bareos-dir.d /bareos-fd.d /bconsole.conf /ssl .rndpwd tray-monitor.d 


To configure the client go to the directory /bareos-fd.d



 /client /director /messages 


By default, after installation, the configuration is scattered into the three directories shown above, so for further convenience we will commit partial configurations in the directories and messages directories, and perform all the settings in /client/myself.conf

Expand
Client {

Name = bitrixvm

Maximum Concurrent Jobs = 20

TLS Enable = yes

TLS Require = yes

TLS CA Certificate File = /etc/bareos/ssl/ca-chain.cert.pem

TLS Certificate = /etc/bareos/ssl/bitrixvm.cert.pem

TLS Key = /etc/bareos/ssl/bitrixvm.nopass.key.pem

compatible = no

}



Director {

Name = bareos-server

Password = "zcx @ # $ BGj"

TLS Enable = yes

TLS Require = yes

TLS Verify Peer = yes

TLS Allowed CN = "bareos-server"

TLS CA Certificate File = /etc/bareos/ssl/ca-chain.cert.pem

TLS Certificate = /etc/bareos/ssl/bitrixvm.cert.pem

TLS Key = /etc/bareos/ssl/bitrixvm.nopass.key.pem

TLS DH File = /etc/bareos/ssl/dh1024.pem

}



Messages {

Name = Standard

Director = bareos-server = all,! Skipped,! Restored

Description = "Send relevant messages to the Director."

}



We enter the parameters and restart the service:



 /etc/init.d/bareos-fd restart 


Register in the hosts address for the bareos-server



On the server side (bareos-server), the configuration for the client (bitrixvm) is as follows: /etc/bareos/bareos-dir.d/bitrixvm.conf:



Expand
Client {

Name = bitrixvm

Address = bitrixvm

Password = "zcx @ # $ BGj"

TLS Enable = yes

TLS Require = yes

TLS CA Certificate File = /etc/bareos/ssl/ca-chain.cert.pem

TLS Certificate = /etc/bareos/ssl/bareos-server.cert.pem

TLS Key = /etc/bareos/ssl/bareos-server.nopass.key.pem



}



Pool {

Name = bitrixvm-bareos-pool-Full

Label Format = "bitrixvm-bareos-client-Full-"

Pool Type = Backup

AutoPrune = yes

Recycle = yes

Volume Retention = 3 months

}



Pool {

Name = bitrixvm-bareos-pool-Differential

Pool Type = Backup

Label Format = "bitrixvm-bareos-client-Differential-"

AutoPrune = yes

Recycle = yes

Select Job resource (1-6): = 11 days

}



Pool {

Name = bitrixvm-bareos-pool-Incremental

Pool Type = Backup

Label Format = "bitrixvm-bareos-client-Incremental-"

AutoPrune = yes

Recycle = yes

Volume Retention = 10 days

}



Job {

Name = Job-bitrixvm-mysql

Type = Backup

Level = Full

Client = bitrixvm

FileSet = bareos-fileset-bitrixvm-mysql

Schedule = "MonthlyCycle"

Storage = bareos-server-sd

Messages = Standart

Pool = bitrixvm-bareos-pool-Incremental

Full Backup Pool = bitrixvm-bareos-pool-Full

Differential Backup Pool = bitrixvm-bareos-pool-Differential

Incremental Backup Pool = bitrixvm-bareos-pool-Incremental



RunScript {

# Run the script described in this section before performing the backup

RunsWhen = Before

# Run the script if the task (Job) fails

RunsOnFailure = Yes

RunsOnClient = Yes

#

# The command for the script itself

Command = "sh -c 'mysqldump -uroot -ppassword --opt --all-databases> /tmp/dump.sql'"

}

}



Job {

Name = Job-bitrixvm-Full

Type = Backup

Level = Full

Client = bitrixvm

FileSet = bareos-fileset-bitrixvm

Schedule = "MonthlyCycle"

Storage = bareos-server-sd

Messages = Standart

Pool = bitrixvm-bareos-pool-Incremental

Full Backup Pool = bitrixvm-bareos-pool-Full

Differential Backup Pool = bitrixvm-bareos-pool-Differential

Incremental Backup Pool = bitrixvm-bareos-pool-Incremental

}



FileSet {

Name = bareos-fileset-bitrixvm

Include {

Options {

compression = GZIP

}

File = "/"

}

}



FileSet {

Name = bareos-fileset-bitrixvm-mysql

Include {

Options {

# Set the type of compression

compression = GZIP

signature = MD5

}

File = "/tmp/dump.sql"

}

}



Job {

Name = Job-bitrixvm-mysql-restore

Type = Restore

Client = bitrixvm

FileSet = "bareos-fileset-bitrixvm-mysql"

Storage = bareos-server-sd

Pool = bitrixvm-bareos-pool-Full

Messages = Standart

Where = / tmp

}



Job {

Name = Job-bitrixvm-Full-restore

Type = Restore

Client = bitrixvm

FileSet = "bareos-fileset-bitrixvm"

Storage = bareos-server-sd

Pool = bitrixvm-bareos-pool-Full

Messages = Standart

Where = / tmp

}



In the RunScript section of the Command parameter, we run the mysqldump command, passing all the necessary "mysqldump -uroot -ppassword --opt --all-databases> /tmp/dump.sql" parameters.



The saved dump.sql file will be backed up as specified for the FileSet called "bareos-fileset-bitrixvm-mysql".



Bareos uses the TLS protocol to encrypt data transfers. For each client and director we must have a CA certificate, certificate and key. We will use self-signed certificates, all this can be done through openssl.



Let's follow the path of the openssl configuration file /etc/pki/tls/openssl.cnf



We generate CA certificate:



 #openssl req -config openssl.cnf -new -x509 -extensions v3_ca -keyout private/myca.key -out certs/myca.crt 


After entering the password and other data, we get two files:



 /etc/pki/CA/private/myca.key /etc/pki/CA/certs/myca.crt 


We will correct / check the settings file openssl.cnf so that the paths to the certificates are correct, bold highlights what needs to be changed.



You also need to create the index.txt and serial files in the / etc / pki / CA folder:



 touch /etc/pki/CA/index.txt 


In the serial file we immediately enter the value “01”, the file will contain the following number for the following certificates:



 echo '01' > /etc/pki/CA/serial 


Openssl.cnf content:
dir = / etc / pki / CA

certs = $ dir / certs

crl_dir = $ dir / crl

database = $ dir / index.txt

#unique_subject = no



new_certs_dir = $ dir / newcerts



certificate = $ dir / certs / myca.crt

serial = $ dir / serial

crlnumber = $ dir / crlnumber



crl = $ dir / crl.pem

private_key = $ dir / private / myca.key

RANDFILE = $ dir / private / .rand



x509_extensions = usr_cert


We generate a key for the server, you will need to enter a password.



 openssl genrsa -aes256 -out bareos-server.key.pem 4096 


We generate a certificate request. The important point is that in this section, when generating the certificate, you must correctly specify the Common Name (CN) so that it matches the name of the machine, otherwise errors will occur when attempting to perform any task. In this example, CN = bareos-server

openssl req -config openssl.cnf -key bareos-server.key.pem -new -sha256 -out bareos-server.csr.pem



We sign CSR through CA, we get the certificate itself



 openssl ca -config openssl.cnf -in bareos-server.csr.pem -out bareos-server.cert.pem 


We remove the password for the key, because bareos need him password free



 openssl rsa -in bareos-server.key.pem -out bareos-server.nopass.key.pem 


We will convert the CA key and certificate into one file with the PEM extension.



 cat /etc/pki/CA/private/myca.key /etc/pki/CA/certs/myca.cert > ca-chain.cert.pem 


Generating DH key



 openssl dhparam -out dh1024.pem -5 1024 


Copy the bareos-server.cert.pem certificates bareos-server.nopass.key.pem ca-chain.cert.pem dh1024.pem to the / etc / bareos / ssl folder that you first need to create and install the bareos group



For each certificate, change the group to bareos



 chgrp bareos * 


Similar actions need to be done for each client (bitrixvm, win-fd):



 openssl genrsa -aes256 -out bitrixvm.key.pem 4096 openssl req -config openssl.cnf -key bitrixvm.key.pem -new -sha256 -out bitrixvm.csr.pem openssl ca -config openssl.cnf -in bitrixvm.csr.pem -out bitrixvm.cert.pem openssl rsa -in bitrixvm.key.pem -out bitrixvm.nopass.key.pem 


Using SCP, copy 4 files bitrixvm.cert.pem bitrixvm.nopass.key.pem ca-chain.cert.pem dh1024.pem to a remote bitrixvm machine in the / etc / bareos / ssl folder, which you must first create and install the bareos group for folder so for certificates.



The bitrixvm client configuration (/etc/bareos/bareos-fd.d/client/myself.conf) in the Director {} section requires that client certificates, but not the director, be registered. In the configuration on the server side (/etc/bareos/bareos-dir.d/bitrixvm.conf), in the Client {} section, director certificates are specified. After making configuration changes, restart the services.



Creating certificates for a win-fd machine is identical.



You also need to register certificates for bconsole, a utility that allows you to manage the director in the /etc/bareos/bconsole.conf file:



Expand
Director {

Name = bareos-server

DIRport = 9101

address = bareos-server

Password = "mmm_777"

TLS Enable = yes

TLS Require = yes

TLS Verify Peer = yes

TLS Allowed CN = "bareos-server"

TLS CA Certificate File = /etc/bareos/ssl/ca-chain.cert.pem

TLS Certificate = /etc/bareos/ssl/bareos-server.cert.pem

TLS Key = /etc/bareos/ssl/bareos-server.nopass.key.pem

}



The backup or restore procedure is as follows. Let's use the bconsole utility, as a greeting we will see *

run Shows all possible jobs:



Expand
* run

A job name must be specified.

The defined Job resources are:

1: Job-Full

2: Job-Full-restore

3: Job-bitrixvm-mysql

4: Job-bitrixvm-Full

5: Job-bitrixvm-mysql-restore

6: Job-bitrixvm-Full-restore

Select Job resource (1-6): 3



Run backup job

JobName: Job-bitrixvm-mysql

Level: Full

Client: bitrixvm

Format: Native

FileSet: bareos-fileset-bitrixvm-mysql

Pool: bitrixvm-bareos-pool-Full (From Job FullPool override)

Storage: bareos-server-sd (From Job resource)

When: 2016-10-16 11:05:16

Priority: 10

OK to run? (yes / mod / no):

# Task left for execution gets JobId

Job queued. JobId = 75



The result of the command can be viewed either through the message command and in response we get something like this:



Expand
16-Oct 11:05 bareos-server-sd JobId 75: Volume “bitrixvm-bareos-client-Full-0011” previously written, moving to end of data.

16-Oct 11:05 bareos-server-sd JobId 75: “bitrixvm-bareos-client-Full-0011” size = 2086097429

16-Oct 11:05 bareos-server-sd JobId 75: Elapsed time = 00: 00: 01, Transfer rate = 319.2 K Bytes / second

16-Oct 11:05 bareos-server JobId 75: Bareos bareos-server 15.2.2 (16Nov15):

Build OS: x86_64-redhat-linux-gnu redhat CentOS Linux release 7.0.1406 (Core)

JobId: 75

Job: Job-bitrixvm-mysql.2016-10-16_11.05.38_07

Backup Level: Full

Client: “bitrixvm” 16.3.1 (01Jul16) x86_64-redhat-linux-gnu, redhat, CentOS release 6.6 (Final), CentOS_6, x86_64

FileSet: “bareos-fileset-bitrixvm-mysql” 2016-10-14 04:57:40

Pool: "bitrixvm-bareos-pool-Full" (From Job FullPool override)

Catalog: “bareos-server” (From Client resource)

Storage: "bareos-server-sd" (From Job resource)

Scheduled time: 16-Oct-2016 11:05:16

Start time: 16-Oct-2016 11:05:42

End time: 16-Oct-2016 11:05:42

Elapsed time: 0 secs

Priority: 10

FD Files Written: 1

SD Files Written: 1

FD Bytes Written: 319,187 (319.1 KB)

SD Bytes Written: 319,285 (319.2 KB)

Rate: 0.0 KB / s

Software Compression: 71.0% (gzip)

VSS: no

Encryption: no

Accurate: no

Volume name (s): bitrixvm-bareos-client-Full-0011

Volume Session Id: 3

Volume Session Time: 1476554202

Last Volume Bytes: 2,086,417,588 (2.086 GB)

Non-fatal FD errors: 0

SD Errors: 0

FD termination status: OK

SD termination status: OK

Termination: Backup OK



Or through the status dir command



Expand
Terminated Jobs:

JobId Level Files Bytes Status Finished Name

================================================= ==================

72 Full 0 0 Error 15-Oct-16 13:39 Job-bitrixvm-Full

73 Full 49,442 515.4 M OK 15-Oct-16 14:03 Job-bitrixvm-Full

74 Incr 20 36.81 K OK 16-Oct-16 02:01 Job-Full

75 Full 1 319.1 K OK 16-Oct-16 11:05 Job-bitrixvm-mysql



Where in the status column, you can view the status of the backup. Job number 75 was successful.



The restore is done by the restore command



 *restore 


Then a list of all possible options will be offered.



To select the JobIds, you have the following choices:



1: List last 20 Jobs run

2: List Jobs where a given File is saved

3: Enter list of comma separated JobIds to select

4: Enter SQL list command

5: Select the most recent backup for a client

6: Select backup for a client

7: Enter a list of files to restore

8: Enter a list of files

9: Find the JobIds of the most recent backup for a client

10: Find the job

11: Enter a list of directories to restore for found JobIds

12: Select full restore to a specified job date

13: Cancel


We will show the list of the last 20 tasks:







Click 3 and specify JobID number, for example 75. After that, we automatically get to the console to select the files that we want to restore.



 cwd is: / $ 


A list of all available commands can be viewed via the help command. We check which files are available in this backup, mark the necessary files with the mark command by specifying the files or via *, thus selecting everything. Upon completion, we execute the done command, after which the dialogue with the system will start



 $ ls tmp/ $ cd tmp/ cwd is: /tmp/ $ ls dump.sql $ mark * 1 file marked. $ done 


The job will require the following

Volume (s) Storage (s) SD Device (s)

================================================= =========================



bitrixvm-bareos-client-Full-0011 bareos-server-sd bareos-sd



Volumes marked with "*" are online.



1 file selected to be restored.



Select the recovery task we need (point 2)



The defined Restore Job resources are:

1: Job-Full-restore

2: Job-bitrixvm-mysql-restore

3: Job-bitrixvm-Full-restore

Select Restore Job (1-3): 2



Set the client for which we perform the recovery (2)



Defined Clients:

1: bareos-fd

2: bitrixvm

3: win-fd

Select the Client (1-3): 2



Using Catalog "bareos-server"

Run Restore job

JobName: Job-bitrixvm-mysql-restore

Bootstrap: /var/lib/bareos/bareos-server.restore.1.bsr

Where: /tmp

Replace: Always

FileSet: bareos-fileset-bitrixvm-mysql

Backup Client: bitrixvm

Restore Client: bitrixvm

Format: Native

Storage: bareos-server-sd

When: 2016-10-16 11:26:54

Catalog: bareos-server

Priority: 10

Plugin Options: *None*

OK to run? (yes/mod/no): yes



yes, mod , . JobId.



 Job queued. JobId=76 


status dir . . , /tmp dump.sql.



 76 1 1.100 M OK 16-Oct-16 11:27 Job-bitrixvm-mysql-restore 


, Bareos , , , , ( MS SQL, Ceph, Gluster, LDAP).










SIM-CLOUD - Fail-safe cloud in Germany



Dedicated servers in reliable data centers in Germany!

Any configuration, quick build and free installation

Source: https://habr.com/ru/post/313124/



All Articles