Developers Club geek daily blog

1 year, 5 months ago
The task to organize backup with GUI and that it is direct as at big uncles got to me. Earlier there was rsnapshot and everything worked wonderfully so far amounts did not increase up to hundreds of gigabytes, the websites and databases, hundreds of test platforms. The park of servers increased and it became difficult to manage all this affair. From all available solutions we selected opensors and stopped on bareos as on the most often used if something happens fast to google.

There was a server under OS Centos 7, raid5 12Tb. I began with installation and at once faced that to me someone already tried to deliver to bareos. That do not suffer and to remake from scratch switched off demons of mariadb, bareos-sd, bareos-fd, bareos-dir.

sudo systemctl stop mariadb bareos-dir bareos-sd bareos-fd

Also deleted old configs:

sudo systemctl stop mariadb
sudo rm -rf /etc/bareos/*
sudo rm -rf /etc/bareos/.* # при установке создаётся скрытый файл со сгенерированными паролями
mysql -uroot -p -e "DROP DATABASE IF EXISTS 'bareos';"

If you do not know the password of root:

To reset the password of root mysql
sudo systemctl stop mariadb
sudo mysqld_safe --skip-grant-tables &
mysql -uroot -e "UPDATE mysql.user SET Password=PASSWORD('Ваш_новый_пароль') WHERE User='root';"
sudo systemctl restart mariadb


If we did not set bareos and mariadb yet.
We add bareos repository:

sudo wget http://download.bareos.org/bareos/release/latest/CentOS_7/bareos.repo -O /etc/yum.repos.d/bareos.repo &&sudo sed -i 's/7/\$releasever/g' /etc/yum.repos.d/bareos.repo &&sudo sed -i 's/\/1...\//\/latest\//g' /etc/yum.repos.d/bareos.repo 

We set packets of bareos and mariadb:

sudo yum install -y bareos-client bareos-database-tools bareos-filedaemon bareos-database-mysql bareos bareos-bconsole bareos-database-common bareos-storage bareos-director bareos-common mariadb-server
sudo systemctl enable mariadb &&sudo systemctl enable bareos-fd &&sudo systemctl enable bareos-sd &&sudo systemctl enable bareos-dir &&sudo systemctl start mariadb
sudo mysql_secure_installation

We create the bareos database:

/usr/lib/bareos/scripts/create_bareos_database
/usr/lib/bareos/scripts/make_bareos_tables -uroot -p
/usr/lib/bareos/scripts/grant_bareos_privileges -uroot -p

Now we have a database and the user of bareos. These scripts create the user without password, we will specify the password for bareos:

mysql -uroot -e "UPDATE mysql.user SET Password=PASSWORD('Ваш_новый_пароль') WHERE User='bareos';"


Well, the primitive came to an end, now in what was actually zatyk. Always knew that linux is under construction of a huge number of simple pieces. To understand how to configure bareos, it seemed to me difficult, and that is why. In many manuals on the Internet settings of a configuration for bacula of the primogenitor of bareos are described, and documentation is written so that in 3 seconds not to understand that where to push. Many manuals have errors, in one I did not understand at all why the section job is placed in the demon of storage. Having smoked all documentation on bareos and bacula I understood that if I want to understand, then it is necessary to draw each section on a piece of paper and what it does with a complete description of all parameters and communications between demons.

The scheme of communication with off. documentation
image

So, we will go slowly on pieces. Let's forget about all demons and other pribulda except mariadb and bareos-dir. All main functionality is described in bareos-dir.conf config located in directory/etc/bareos/. The rights to the directory have to be 770, the owner of root bareos group. The rights to files in the directory have to be 640, the owner of root bareos group if you use the enclosed directories — do not forget that the execution bit for the directory allows to browse directory contents therefore the rights of the enclosed directories also have to be 770, the owner of root bareos group.

/ etc/bareos/bareos-dir.conf
Comments begin # C of a grid, required parameters are not commented out
Director { # beginning description of section of the server
Name = agima-dir # Name of this server
#WorkingDirectory = "$HOME/bareos/bin/working" # So is specified a working directory
#Pid Directory = "$HOME/bareos/bin/working" # PID file Location
QueryFile = "/usr/lib/bareos/scripts/query.sql" #набор sql of requests for work with metadata
#Maximum Concurrent Jobs = 10 # Maximum quantity of at the same time started tasks
Password = "password" # the Password for access to this server
#Description = "Main Bareos Director" # Description of the server
Messages = Daemon # we enter a name of section of generation of messages
#Auditing = yes # to write the actions made on the server (an input, start of a task, recovery, etc.). This separate parameter gemmated from the Messages parameter.
#FD Connect Timeout = 180 # time how many to expect the answer of the client
#SD Connect Timeout = 1800 # time how many to expect the answer from the storage server
#Maximum Connections = 30 # maximum simultaneous login to this server
#Maximum Console Connections = 30 # maximum number of the simultaneous connected consoles to this server

#Dir Address = 1.2.3.4 9101 # domain name or ayp the address, port has to be specified through a space or in separate parameter

#Dir Addresses = { # to specify several certain domains and/or ayp of addresses
# ip = { addr = 1.2.3.4; port = 1205; }
# ipv4 = { addr = 1.2.3.4; port = http; }
# ipv6 = { addr = 201:220:222:: 2; port = 1205; }
# ip = { addr = server.example.com }
#}

#Dir Port = 9101 # port number on which will listen to the server
}
@ inserts (include) of other files begin character # C
# If you want to insert several files from a directory you can use construction below
#@| "sh - with ’for f in/etc/bareos/jobs/*.conf; do echo @ $ {f}; done’"
#@/etc/bareos/jobs/1.conf

# B the file specified not all parameters of the section Director, more complete list can be received on the official site of the bareos.org program

We described the server, now we can start it:

systemctl start bareos-dir

The server is, it works, but does nothing and it has no place where to put our backups. The demon bareos-sd is responsible for file allocation, its configuration file is called bareos-sd.conf:

/ etc/bareos/bareos-sd.conf
Storage { # beginning of section of the description of the demon of storage
#Absolute Job Timeout = 20 # total time of waiting of a task
#Allow Bandwidth Bursting = no # to permit to increase width of the channel
#Client Connect Wait = 1800 #время how many to expect the answer of the console
= no # to collect by #Collect Device Statistics statistics on devices
= no # to collect by #Collect Job Statistics statistics on tasks
#Compatible = no # mode of compatibility with bacula
Description = "First storage server" # Description of the server
#FD Connect Timeout = 1800 # time how many to expect the answer of the client
= no # to permit #File Device Concurrent Read simultaneous reading from devices
#Maximum Bandwidth Per Job = 1 k/s # the Maximum width of the channel is at 1 task, values of speed k/s, kb/s, m/s or mb/s.
#Maximum Concurrent Jobs = 20 # Maximum quantity of at the same time carried out tasks
#Maximum Network Buffer Size = 65536 # size of the network buffer in bytes if low speed try to change. Sometimes for fall forward it is worth reducing the buffer size.
Messages = Standard # we enter a name of section of generation of messages
Name = agima-sd # name of this server of storage
#Pid Directory = / var/lib/bareos # PID file Location
#SD Address = 1.2.3.4 9103 # domain name or ayp the address, port has to be specified through a space or in separate parameter

#SD Addresses = { # to specify several certain domains and/or ayp of addresses
# ip = { addr = 1.2.3.4; port = 1205; }
# ipv4 = { addr = 1.2.3.4; port = http; }
# ipv6 = { addr = 201:220:222:: 2; port = 1205; }
# ip = { addr = server.example.com }
#}

#SD Connect Timeout = 1800# Maximum waiting time of connection
#SD Port = 9103# port number on which will listen to the server
#SD Source Address = # the specific (separate) address which listens to the server for communication with the client
#Secure Erase Command = string# the parameter for the instruction what to use command for irrevocable removal
#Statistics Collect Interval = 30 # interval for collecting of statistics
#Working Directory = / var/lib # working directory
}

Director { # beginning description of section of connection to this server of storage
Name = agima-dir # we enter server name which can be connected to us
Password= "password1" # the password with which will be will be connected
Description = "Backup server" # Description of the server
#Key Encryption Key = password # data exchange encrypting key
#Maximum Bandwidth Per Job = 1 k/s # the Maximum width of the channel is at 1 task, values of speed k/s, kb/s, m/s or mb/s.
#Monitor = no # Permits full or limited access to the server. Limited access allows to browse the status of the server only.
}

Device { # beginning of the description of storage location
Always Open = no; # Always to hold opened the device
Archive Device = / opt/backup # Way of saving
#Auto Deflate = Parameter works with out # only at turning on of the autoxflate-sd module. Values: in — compression of flows when reading from the device, out compression at record on the device, compression both in both cases.
#Auto Deflate Algorithm = GZIP # GZIP — gzip level 1–9, LZO, LZFAST, LZ4, LZ4HC
#Auto Deflate Level = 6 # level of compression
#Auto Inflate = Parameter works with in # only at turning on of the autoxflate-sd module. Values: in — compression of flows when reading from the device, out compression at record on the device, compression both in both cases.
#Auto Select = yes # Automatic choice of this device
#Automatic Mount = yes; # automatically to mount the device
#Block Checksum = yes # Includes check of checksums of CRC32, also allows to read out beaten data
#Check Labels = yes # Includes check of tags for records not of an ANSI format
#Close On Poll = no # to remount the device
= yes # to Collect by #Collect Statistics statistics
Description = "Primary raid storage" # Description of the device
#Device Options = are used by string # of an option of the device for external plug-ins of Ceph and GlusterFS
Device Type = File # device Type: Cartridge Tape; USB stick File, disks, network drives; GFAPI (GlusterFS); Rados (Ceph Object Store); Fifo of the device of posledovatlny read-only access or only for record.
Label Media = yes; # to permit the server to set a tag on blocks / accept Bareos set label unlabeled media
Label Type = primary # a tag which will be set
Maximum Concurrent Jobs = 4 # maximum quantity of simultaneous tasks
Maximum File Size = 500 Gb # maximum file size
#Maximum Job Spool Size = # Maksiamalny amount of queue of a task
#Maximum Network Buffer Size = 65536 # size of the network buffer in bytes if low speed try to change. Sometimes for fall forward it is worth reducing the buffer size.
Maximum Open Volumes = 1 # maximum quantity of open volumes
Maximum Open Wait = 15 # maximum waiting time of the device
#Maximum Spool Size = # Maksiamalny amount of queue of tasks
Media Type = File # is text parameter where you can specify freely device type what most of all it is pleasant to you
#Mount Command = Strname # command of assembling of this device
#Mount Point = Strname # mount point
Name = AgimaStorage # name of this storage location
Random Access = yes; # specifies support of accidental data access, cartridges have no such opportunity
Removable Media = no; Whether # we specify the switched-off device
Whether Requires Mount = is required to no # assembling of this device
#Spool Directory = directory # the Directory for creation of temporary files, by default the current directory
#Unmount Command = Strname # command of dismounting
#Volume Capacity = # volume size
}

Messages {
Name = Standard # name of the current notification
Description = "Standard messages file daemon" # description of the notification
#Mail Command = # command of sending email, has to be described before the parameters Mail, Mail On Error, Mail On Success
#Mail Command = "/usr/sbin/bsmtp - h mail.example.com - f \" \(Bareos \) \%r \" - s \"Bareos: \%t \%e of \%c \%l \" \%r"

##%% = % percent character
##%c = Client's name \Customer name
##%d = Director's name \Server name
##%e = Job Exit code (OK, Error...) \Status of end
##%h = Client address \host of the client
##%i = task Job Id \Identifier
##%j = Unique Job name \Is unique task name
##%l = task Job level \priority
##%n = Job name \Task name
##%r = Recipients \receivers
##%s = \# I Will be glad to Since time if someone explains that he means this parameter
##%t = Job type (e.g. Backup...) \Task type
##%v = Read Volume name (Only on director side) \Is read volume with a name
##%V = Write Volume name (Only on director side) \Is written volume with a name

#Operator Command = has to be described by string # to the Operator parameter. Mail Command is similar, but sends to the operator

##Типы notifications message-type:
##info information messages
##warning Notifications
##error errors
##fatal errors because of which tasks stop
##terminate messages at shutdown of the server
##notsaved files are not saved
##skipped the passed files which got to exceptions either at an incremental backup or at other settings or actions of the user
##mount assembling is complete
##restored the list of the recovered files
##all all messages
##security messages of info and warning only in attempts it will be connected
##alert messages the generated tape alerts
##volmgmt messages of volume management
##audit messages on the performed operations

#Append = [address =] message-type [message-type] * # Adds the message to the file if the file does not exist it will be created
director = backup-dir = all # sending message for the bareos server
#Catalog = # sending message to the database of the directory
#Console = # sending message to the console
#File = # sending the message to the file if the file exists it it will be rewritten
#Mail = # sending the message for the specified address
#Mail On Error = # email at an error
#Mail On Success = # email at success
#Operator = # to send email to the specified address to the operator
#Stderr = # sending message to standard output of errors
#Stdout = # sending message for standard output
#Syslog = # sending message to Syslog log
}

So now we configured the storage server, we will connect it to our server, we add to the end of the file:

/ etc/bareos/bareos-dir.conf
Storage {
= 127.0.0.1 # address to which we are connected by Address
Whether = yes # to Permit Allow Compression compression
#Auth Type = MD5 # method of authorization None|Clear|MD5
Whether = yes # to Collect by #Collect Statistics statistics
Description = "Primary storage" # Description of the current section
Device = to FirstStorage # the used device, value is equal to the section device name parameter
Whether Enabled = is included by yes # this server of storage
#Maximum Bandwidth Per Job = 1 k/s # the Maximum width of the channel is at 1 task, values of speed k/s, kb/s, m/s or mb/s.
#Maximum Concurrent Jobs = 1 # maximum quantity of simultaneous tasks
#Maximum Concurrent Read Jobs = 0 # maximum quantity of simultaneous tasks on the chtena
Media Type = File # is text parameter where you can specify device type in a free form what most of all it is pleasant to you
Name = agima-sd # name of this section
Password = password1 # the password for connection to the storage server
#Port = 9103 # port to which will be connected
}

Catalog {
DB Address = localhost # network address of the Database
DB Driver = mysql # we Select postgresql DBMS | mysql | sqlite
DB Name = bareos # database Name
DB Password = "123" # the User password for DBMS
DB Port = 3306 # Port at which works as DBMS
#DB Socket = string # a way to the Database socket if we use a socket
DB User = bareos # User of DBMS DBMS
Description = "Catalog metadata for bareos" # Description of Section
Disable Batch Insert = Permits no # multiple inserts
#Exit On Fatal = no # to close the program at an error
#Idle Timeout = 30 # Waiting time of communication with base
#Inc Connections = 1 # If ended loose connections, it is possible to add how many it is specified in this parameter
#Max Connections = 5 # Maximum number of connections
#Min Connections = 1 # Minimum quantity of connections
Name = agima-meta # Name of the current section
Reconnect = to be reconnected by yes # to the database if communication is terminated
#Validate Timeout = 120 # Time of check whether the DB works or not
}


We reboot the server and we start storage:

sudo systemctl restart bareos-dir
sudo systemctl start bareos-sd

If between them there is no communication configure firewall.

Now we have a server and the place where to put backups. Servers are started, but to do backups there is nobody. Let's configure the client who will do backups. A client is the demon bareos-fd, its configuration file is called bareos-fd.conf and it is the simplest:

/ etc/bareos/bareos-fd.conf
Client {
#Absolute Job Timeout = 20 # total time of waiting of a task
#Allow Bandwidth Bursting = yes # to permit to increase width of the channel
#Allowed Job Command = # Types of the permitted commands for this client: backup creation of backups; restore recovery of files; verify verification of files; estimate check of the permitted commands; runscript start of scripts
#Allowed Script Dir = # Directories from which it is authorized to client to start scripts
#Compatible = no # Mode of compatibility with bacula
Description = "First client on server example.com" # description of the client
#FD Address = 1.2.3.4 9102 # domain name or ayp the address, port has to be specified through a space or in separate parameter
#FD Addresses = { # to specify several certain domains and/or ayp of addresses
# ip = { addr = 1.2.3.4; port = 1205; }
# ipv4 = { addr = 1.2.3.4; port = http; }
# ipv6 = { addr = 201:220:222:: 2; port = 1205; }
# ip = { addr = server.example.com }
#}
#FD Port = 9102 # port number on which will be listened by the client
#FD Source Address = # the specific (separate) address to which the client for contact with the storage server listens
#Maximum Bandwidth Per Job = 1 k/s # the Maximum width of the channel is at 1 task, values of speed k/s, kb/s, m/s or mb/s.
#Maximum Concurrent Jobs = 20 # Maximum quantity of at the same time carried out tasks
#Maximum Network Buffer Size = 65536 # size of the network buffer in bytes if low speed try to change. Sometimes for fall forward it is worth reducing the buffer size.
Messages = standard # we enter a name of section of generation of messages
Name = agima-client # Name of this client
#Pid Directory = / var/lib/bareos # Directory of storage of the PID file
#Scripts Directory = the Directory where are stored by directory # scripts
#SD Connect Timeout = 1800 # Waiting time for a yapodklyucheniye to the storage server
#Secure Erase Command = string # Command of bzvozvratny removal
#Working Directory = / var/lib/bareos # Working directory
}

Director {
#Address = 1.2.3.4 # Address to which we are connected
#Allowed Job Command = # Types of the permitted commands for the server: backup creation of backups; restore recovery of files; verify verification of files; estimate check of the permitted commands; runscript start of scripts
#Allowed Script Dir = "/etc/bareos" # Directories from which it is authorized to server to start scripts
#Allowed Script Dir = "/path/that/is/also/allowed" #
Description = "General backup server" # Description of the server
#Maximum Bandwidth Per Job = 1 k/s # the Maximum width of the channel is at 1 task, values of speed k/s, kb/s, m/s or mb/s.
#Monitor = no # Permits full or limited access to the server. Limited access allows to browse the status of the server only.
Name = backup-dir # Server name which can be connected
Password = Md5password # the password for connection to the client ciphered in md5
}

Messages {
Name = Standard # name of the current notification
Description = "Standard messages file daemon" # description of the notification
#Mail Command = # command of sending email, has to be described before the parameters Mail, Mail On Error, Mail On Success
#Mail Command = "/usr/sbin/bsmtp - h mail.example.com - f \" \(Bareos \) \%r \" - s \"Bareos: \%t \%e of \%c \%l \" \%r"

##%% = % percent character
##%c = Client's name \Customer name
##%d = Director's name \Server name
##%e = Job Exit code (OK, Error...) \Status of end
##%h = Client address \host of the client
##%i = task Job Id \Identifier
##%j = Unique Job name \Is unique task name
##%l = task Job level \priority
##%n = Job name \Task name
##%r = Recipients \receivers
##%s = \# I Will be glad to Since time if someone explains that he means this parameter
##%t = Job type (e.g. Backup...) \Task type
##%v = Read Volume name (Only on director side) \Is read volume with a name
##%V = Write Volume name (Only on director side) \Is written volume with a name

#Operator Command = has to be described by string # to the Operator parameter. Mail Command is similar, but sends to the operator

##Типы notifications message-type:
##info information messages
##warning Notifications
##error errors
##fatal errors because of which tasks stop
##terminate messages at shutdown of the server
##notsaved files are not saved
##skipped the passed files which got to exceptions either at an incremental backup or at other settings or actions of the user
##mount assembling is complete
##restored the list of the recovered files
##all all messages
##security messages of info and warning only in attempts it will be connected
##alert messages the generated tape alerts
##volmgmt messages of volume management
##audit messages on the performed operations

#Append = [address =] message-type [message-type] * # Adds the message to the file if the file does not exist it will be created
director = backup-dir = all # sending message for the bareos server
#Catalog = # sending message to the database of the directory
#Console = # sending message to the console
#File = # sending the message to the file if the file exists it it will be rewritten
#Mail = # sending the message for the specified address
#Mail On Error = # email at an error
#Mail On Success = # email at success
#Operator = # to send email to the specified address to the operator
#Stderr = # sending message to standard output of errors
#Stdout = # sending message for standard output
#Syslog = # sending message to Syslog log
}

Hurrah we described the client, now we will connect him to our server, we will insert into the end of the bareos-dir.conf file:

/ etc/bareos/bareos-dir.conf
Client {
= yes # to permit #Allow Client Connect incoming connections from the client
#Auth Type = MD5 # Type of authorization None|Clear|MD5
#Auto Prune = no # Automatic to clear records from the directory about outdated tasks
#Catalog = resource-name # the directory used for storage of metadata
#Description = string # description of this client
Whether #Enabled = yes # is included this client
#FD Address = string # the address for connection to the client
#FD Password = password # the password for connection with the client
#FD Port = 9102 # port on which
#File Retention = 5184000 # Storage period of story about files in the directory
#Hard Quota = 0 # Data volume available to an ipspolzovaniye, when exceeding a task is cancelled
#Job Retention = 15552000 # Storage period of story about tasks in the directory
#Maximum Bandwidth Per Job = 1 k/s # the Maximum width of the channel is at 1 task, values of speed k/s, kb/s, m/s or mb/s.
#Maximum Concurrent Jobs = 1 # maximum quantity of at the same time started tasks
#Name = agima-client # unique customer name to which we are connected
#Passive = the passive mode, incoming connections are unavailable to no #
#Quota Include Failed Jobs = yes # to Consider the amount of unsuccessful tasks in quotas
#Soft Quota = 0 # Data volume available to an ipspolzovaniye, when exceeding a task is not cancelled
}


We start the client, we restart the server and as usual we do not forget to configure firewall.

sudo systemctl restart bareos-dir
sudo systemctl start bareos-fd

Now we have everything, but backups all the same do not become. Let's add tasks and the schedule for their execution.

To unroll
Pool {
#Action On Purge = Truncate # to Cut off sections when cleaning for reduction of busy amount
= yes # Automatically to delete with Auto Prune outdated sections
= resource-name # we Specify by Catalog the directory in which to store metadata
Catalog Files = yes # to Write names of files in the directory
Description = string # Description of a pool
#File Retention = time # How long to save records about files in the directory
#Job Retention = time # How long to save records about tasks in the directory
Label Format = "backup -" # a prefix for files of a backup
#Label Type = ANSI|IBM|Bareos # prefix Type
#Maximum Blocksize = positive-integer # Maximum size of the block by default 63KB
Maximum Volume Bytes = Size64 # Maximum volume size (file of reserve archive)
Maximum Volume Files = positive-integer # the Maximum quantity of tasks in one volume
Maximum Volume Jobs = positive-integer # the Maximum quantity of tasks in one volume
Maximum Volumes = positive-integer # Maximum quantity of volumes
Name = agima-pool # Name of this pool
Pool Type = Strname # Backup pool Type, * Archive, * Cloned, * Migration, * Copy, * Save
= yes # to Delete with Purge Oldest Volume outdated volumes
Recycle = yes # If is not enough place, to look for outdated files and volumes and to clear them
Recycle Current Volume = yes # to Clear the current volume
Recycle Oldest Volume = yes # to Clear outdated volumes
Recycle Pool = resource-name # to Clear a pool, povzolyat automatically to move backups to other pool
Scratch Pool = the name Scratch is reserved by resource-name # for a pool of spare volumes — if necessary the system independently transfers volume from it to a required pool
Storage = ResourceList # Used storage servers
Use Catalog = yes # to Save metadata in a DB
Volume Retention = 31536000 # How long to save records about volumes in the directory
Volume Use Duration = 7 days # As long volume is available to record
}

FileSet { # rule of file set
Description = string # Description of the current rules
#Enable VSS = yes # Includes shadow copying of volume for Windows
Name = agima-site# unique name of this rule
{ # we specify by # Exclude what files we exclude
# Options {
# AutoExclude = Is used by yes # for Windows. Will check the excluded files according to the register.
# fstype=ext2 # Available file systems for complete copying of a disk volume. ext2, jfs, ntfs, proc, reiserfs, xfs, usbdevfs, sysfs, smbfs, iso9660
# sparse=yes # in raw files to exclude zero if them 32K in the block in a row
To Use # onefs=yes # only 1 file system
# signature=MD5 # SHA1 algorithm for check of changes.
# recurse=yes # recursive pass on directories
Not to change # noatime=yes # time of file access
To check # mtimeonly=yes # For incremental and diffirintsialny copying only st_mtime. In the switched-off status checks also st_ctime.
Not to change # keepatime=yes # access time
# checkfilechanges=yes # to check changes of files
# aclsupport=yes # Support of the augmented list of access for Linux
# xattrsupport=yes # Support of additional file attributes
# ignore case=yes # not to consider the register
# DriveType=Windows-drive-type # the Used disk type for Windows: removable, fixed, remote, cdrom, ramdisk
# hfsplussupport=yes # Support of file system of Apple

# size =
# - — Select file in range size — size. # the Size in the range
#<size — Select files smaller than size. # Files it is less than the specified size
#>size — Select files bigger than size. # Files it is more than the specified size
#size — Select files which are within of 1% of size. # Files of the specified size ± 1%

# verify =
#i compare the inodes # of Comparison of index descriptors
#p compare the permission bits # of Comparison of the rights to the file
#n compare the number of links # Quantity of file references
#u compare the user id # Comparison of a user ID
#g compare the group id # Comparison of the identifier of group
#s compare the size # of Comparison of the size
#a compare the access time # of Comparison of a vremeniye of access
#m compare the modification time (st_mtime) # Comparisons of a vremeniye of modification
#c compare the change time (st_ctime) # Comparisons of a vremeniye of change
#d report file size decreases # report of change of the file of the size
#5 compare the MD5 signature # Comparison hash of the sums of the MD5 files
#1 compare the SHA1 signature # Comparison hash of the sums of the SHA1 files
#A Only for Accurate option, it allows to always backup the file # the option Accurate at the description of file set (allows to set check of checksums, and not just check of time of creation/change of the file at determination of the list of the changed files)

# compression=GZIP5 # to include compression of GZIP1-9|LZO|LZFAST|LZ4|LZ4HC
# }
# File = "|sh - with ’df - l | grep \" ^/dev/hd[ab] \" | grep - v \".*/tmp \" | awk \" { print \\$}6 \\"'"
# File = /
# File = / usr
# }
Ignore File Set Changes = no # in case of change of the rule, the following task which uses it will do a complete backup. At the yes parameter setting to the following complete backup the old rule will be used.
{ # we specify by # Include what files we take
# Options {
# File = /
# File = / usr
# Exclude Dir Containing = .nobackup # to exclude the directory containing the file
# }
}

Schedule {
Description = string # Description of the schedule
Enabled = yes # Inclusion of the schedule
Name = MonthlyCycle # Unique name of the schedule
Run = Level=Full Pool=Monthly 1st sun at 2:05
Run = Level=Differential 2nd-5th sun at 2:05
Run = Level=Incremental Pool=Daily mon-sat at 2:05
# Month of jan | feb | mar | apr | may | jun | jul | aug | sep | oct | nov | dec | january | february | … | december | monthly
# sun Days of the week | mon | tue | wed | thu | fri | sat | sunday | monday | tuesday | wednesday | thursday | friday | saturday | daily
# Numbers of weeks in a month 1st | 2nd | 3rd | 4th | 5th | first | second | third | fourth | fifth | last
# hours and minutes "at 00:00"
# Numbers of weeks in a year of w00 | w01 | … w52 | w53
# numbers of days in a month and ranges are available through "-"
}

Job {
Accurate = yes # receives the file list from the director, saved in the previous tasks, file systems with a large number of files require many OP on the client
Add Prefix = string # Adding of a prefix
Add Suffix = string # Adding of a postfix
Allow Duplicate Jobs = yes # Permits to duplicate start of a task
Allow Higher Duplicates = if duplicates are prohibited yes #, then to select a task with the highest priority
Allow Mixed Priority = no # allows a priority task to begin, without waiting for end low-priority
Base = the files which did not change since basic copying are not duplicated by ResourceList # at any type of backup. The task name is entered.
Bootstrap = directory # at backup in this file registers information which allows to recover files easier

#%% — %
#%c — customer name
#%d — a name of the director
#%e — the status of execution (OK, Error, Fatal Error, Canceled, Differences, Unknown term code)
#%i — the task identifier
#%j — a unique identifier of a task
#%l — backup type
#%n — a task name
#%s — time (?)
#%t — task type
#%v — volume name

Cancel Lower Level Duplicates = if duplicates are prohibited yes #, then to interrupt a low-priority task
Cancel Queued Duplicates = if duplicates are prohibited yes # and the task with the same name already stands in a queue, then to interrupt it
Cancel Running Duplicates = if duplicates are prohibited yes # and the task with the same name is already performed, then to interrupt it
Catalog = agima-meta # the Name of the used directory for saving of metadata
Client = agima-client # On what client to start a task
Client Run After Job = RunscriptShort # Start of a script on the client after execution of a task
Client Run Before Job = RunscriptShort # Start of a script on the client before execution of a task
Description = string # Description of a task
Differential Backup Pool = agima-pool # the Used pool for a diffirintsialny backup
Differential Max Runtime = time # Maximum mremya execution backup diff
Whether Enabled = Is included by yes # a task
File Set = agima-site # the Used rule of file set
Full Backup Pool = agima-pool # the Used pool for a complete backup
Full Max Runtime = time # Maximum mremya execution of a complete backup
Incremental Backup Pool = agima-pool # the Used pool for a diffirintsialny backup
#Incremental Max Runtime = time # Maximum runtime of an incremental backup
#Job Defs = Preset resource-name # for the description of a task.
#Job To Verify = resource-name # the Task for check of a backup
Level = Sets to BackupLevel # level for task type: for creation of backups of VirtualFull | Full | Incremental | Differential, for check of InitCatalog verification of the existing files with the list from the directory | Catalog of comparison of the current list and previous | VolumeToCatalog compares attributes of files to entries in the directory and if in the directory write a hash of the sum compares also them | DiskToCatalog too as previous only for disks, for recovery of Restore.
Max Concurrent Copies = 100 # Maximum quantity of at the same time zashcheny copies of a task
Max Di ff Interval = time # allows to set the maximum period between differential backup copies, at its exceeding backup of changes turns into differential copying
Max Full Interval = time # allows to set the maximum period between complete backup copies, at its exceeding backup of changes turns into complete copying
Max Run Time = time # maximum time of execution
Max Start Delay = time # the maximum waiting in queue on start
Max Virtual Full Interval = time # allows to set the maximum period between trial complete backup copies, at its exceeding backup of changes turns into trial complete copying
Max Wait Time = time # waiting of installation of volume from launch
Maximum Bandwidth = k/s # Maximum width of the channel, value of speed k/s, kb/s, m/s or mb/s.
Maximum Concurrent Jobs = 1 # quantity of at the same time started tasks
Maxrun Sched Time = time # (Max Start Delay + Max Run Time)
Messages = standard required # the Used notifications
Name = agima-site required # Unique task name
#Next Pool = resource-name # an assignment pool name for a migration job
Pool = agima-pool # the Used pool
Prefer Mounted Volumes = yes # minimizes quantity of montirovaniye or parallelizes record
Prefix Links = "not into place" absolute symbol links are modified by no # at recovery in compliance
Priority = 10 # Priority of a task the is more than a digit the more important. 1-255
Prune Files = no # to clear files from the directory
Prune Jobs = no # to clear tasks from the directory
Prune Volumes = no # to clear volumes from the directory
= no # to Delete with Purge Migration Job a problem of migration upon termination of
Regex Where = string # At recovery
Replace = Always # always — always, ifnewer — if is never newer, never — ifolder — if is more senior At recovery to replace files by the specified rules
Rerun Failed Levels = yes # to raise a task priority at restart
= 1800 # to restart Reschedule Interval through the specified interval
Reschedule On Error = yes # to Restart a task at an error
Reschedule Times = 5 # number of repeated attempts of start
Run = "l since= % Nightly-backup level= \" %s \"storage=DDS-4" # Task name, level, parameters storage server
Run Script {
Command = "echo test" # the executed command
Runs When = After # When to start Never never | Before before | After after | Always always | AfterVSS after shadow copying
Runs On Failure = yes # Start at an error
Runs On Client = no # start on the client
Runs On Success = yes # Start at success
}
Schedule = MonthlyCycle # the Used schedule
Storage = ResourceList # the Used storage server
Strip Prefix = string # At recovery to cut off the specified prefix
Type = creation of a backup, Restore recovery of a backup, Verify check of a backup, Migrate movement of a backup, Admin is started by JobType # Backup for autodata scrubbing in the directory whether Copy check is data for copying
#Virtual Full Backup Pool = resource-name # the Used pool for a complete virtaulny backup
Where = a directory where will be recovered by directory # files
Write Bootstrap = directory # a directory of saving of the files describing
Write Verify List = directory # place of saving of a log of check
}

Messages {
Name = Standard # name of the current notification
Description = "Standard messages file daemon" # description of the notification
#Mail Command = # command of sending email, has to be described before the parameters Mail, Mail On Error, Mail On Success
#Mail Command = "/usr/sbin/bsmtp - h mail.example.com - f \" \(Bareos \) \%r \" - s \"Bareos: \%t \%e of \%c \%l \" \%r"

##%% = % percent character
##%c = Client's name \Customer name
##%d = Director's name \Server name
##%e = Job Exit code (OK, Error...) \Status of end
##%h = Client address \host of the client
##%i = task Job Id \Identifier
##%j = Unique Job name \Is unique task name
##%l = task Job level \priority
##%n = Job name \Task name
##%r = Recipients \receivers
##%s = \# I Will be glad to Since time if someone explains that he means this parameter
##%t = Job type (e.g. Backup...) \Task type
##%v = Read Volume name (Only on director side) \Is read volume with a name
##%V = Write Volume name (Only on director side) \Is written volume with a name

#Operator Command = has to be described by string # to the Operator parameter. Mail Command is similar, but sends to the operator

##Типы notifications message-type:
##info information messages
##warning Notifications
##error errors
##fatal errors because of which tasks stop
##terminate messages at shutdown of the server
##notsaved files are not saved
##skipped the passed files which got to exceptions either at an incremental backup or at other settings or actions of the user
##mount assembling is complete
##restored the list of the recovered files
##all all messages
##security messages of info and warning only in attempts it will be connected
##alert messages the generated tape alerts
##volmgmt messages of volume management
##audit messages on the performed operations

#Append = [address =] message-type [message-type] * # Adds the message to the file if the file does not exist it will be created
director = backup-dir = all # sending message for the bareos server
#Catalog = # sending message to the database of the directory
#Console = # sending message to the console
#File = # sending the message to the file if the file exists it it will be rewritten
#Mail = # sending the message for the specified address
#Mail On Error = # email at an error
#Mail On Success = # email at success
#Operator = # to send email to the specified address to the operator
#Stderr = # sending message to standard output of errors
#Stdout = # sending message for standard output
#Syslog = # sending message to Syslog log
}

Authorization according to certificates remained out of this article, you can always read official documentation or other manuals on the Internet. Notes on a design are accepted.

This article is a translation of the original post at habrahabr.ru/post/272869/
If you have any questions regarding the material covered in the article above, please, contact the original author of the post.
If you have any complaints about this article or you want this article to be deleted, please, drop an email here: sysmagazine.com@gmail.com.

We believe that the knowledge, which is available at the most popular Russian IT blog habrahabr.ru, should be accessed by everyone, even though it is poorly translated.
Shared knowledge makes the world better.
Best wishes.

comments powered by Disqus