About how I blunted a week in Bareos

The task came to me to organize a backup from the GUI and to just like that of big uncles. Previously, rsnapshot stood and everything worked wonderfully until the volumes increased to hundreds of gigabytes, sites and databases, hundreds of test sites. The server fleet has increased and it has become difficult to manage all this business. Of all the available solutions, we chose open source and settled on bareos as the most commonly used, in which case quickly google.

There was a server for Centos 7, raid5 12Tb. I started with the installation and immediately ran into the fact that before me someone was already trying to put bareos. In order not to suffer and remake from scratch turned off the daemons mariadb, bareos-sd, bareos-fd, bareos-dir.

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

And deleted the 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 root password:

Reset mysql root password
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


In case we have not installed bareos and mariadb yet.
Add the 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 

Install bareos and mariadb packages:

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

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 a bareos user. These scripts create a user without a password, specify a password for bareos:

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


Well, the primitive ended, now what was the actual plug. I always knew that linux is built from a huge number of simple pieces. It seemed difficult to understand how to configure bareos, and here's why. Many Internet manuals describe the configuration settings for the bacula of the progenitor bareos, and the documentation is written so that in 3 seconds you can’t understand what to shove. Many manuals have errors, in one I did not understand at all why the job section is placed in the storage daemon. Having smoked all the documentation on bareos and bacula, I realized that if I want to understand, I will have to draw each section on a piece of paper and what it does with a full description of all the parameters and connections between demons.

Scheme of communication with off. documentation
image

So, let's go slowly piece by piece. Forget about all the demons and other bells and whistles except mariadb and bareos-dir. All main functionality is described in the bareos-dir.conf config located in the / etc / bareos / directory. Directory rights must be 770, the owner of the root group bareos. The rights to the files in the directory must be 640, the owner of the root group is bareos, if you use subdirectories - do not forget that the execution bit for the directory allows you to view the contents of the directory, so the rights of the subdirectories should also be 770, the owner of the root group is bareos.

/etc/bareos/bareos-dir.conf
# Comments begin with a lattice, mandatory parameters are not commented out
Director {# start of server section description
Name = agima-dir # Name of this server
#WorkingDirectory = "$ HOME / bareos / bin / working" # This is the working directory
#Pid Directory = "$ HOME / bareos / bin / working "# Location of the PID file
QueryFile =" /usr/lib/bareos/scripts/query.sql "# set of sql queries for working with metadata
#Maximum Concurrent Jobs = 10 # Maximum number of simultaneously running tasks
Password = "Password" # Password to access this server
#Description = "Main Bareos Director" # Server description
Messages = Daemon # indicate the name of the generation section i
#Auditing = yes # record actions performed on the server (logging in, starting a task, restoring, etc.). This separate parameter has budged from the Messages parameter.
#FD Connect Timeout = 180 # time how much to wait for a client response
#SD Connect Timeout = 1800 # time how much to wait for a response from the storage server
#Maximum Connections = 30 # maximum number of simultaneous connections to this server
#Maximum Console Connections = 30 # maximum number of simultaneous connections consoles to this server

#Dir Address = 1.2.3.4 9101 # domain name or IP address, the port must be specified with a space or in a separate parameter

#Dir Addresses = {# To specify several specific domains and / or IP 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 the server will listen
}
# The @ symbol starts inserting other files
# If you want to insert several files from the directory, you you can use the construct below
# @ | “sh -c 'for f in /etc/bareos/jobs/*.conf; do echo @ $ {f}; done '»
#@/etc/bareos/jobs/1.conf

# The file does not contain all the parameters of the Director section, a more complete list can be obtained on the official website of the bareos.org program

We described the server, now we can start it:

systemctl start bareos-dir

There is a server, it works, but does nothing and it has no place where to put our backups. The bareos-sd daemon is responsible for placing the files, its configuration file is called bareos-sd.conf:

/etc/bareos/bareos-sd.conf
Storage {# beginning of the description section of the storage daemon
#Absolute Job Timeout = 20 # total time to wait for the task
#Allow Bandwidth Bursting = no # allow to increase the channel width
#Client Connect Wait = 1800 # time how long to wait for the console response
#Collect Device Statistics = no # collect device statistics
#Collect Job Statistics = no # collect task statistics
#Compatible = no # bacula compatibility mode
Description = “First storage server” # Server description
#FD Connect Timeout = 1800 # time how long to wait for a client response
#File Device Concurrent Read = no # allow simultaneous reading from devices
#Maximum Bandwidth Per Job = 1 k / s # Maximum channel width for 1 task, speed values ​​k / s, kb / s, m / s or mb / s.
#Maximum Concurrent Jobs = 20 # Maximum number of simultaneously running tasks
#Maximum Network Bu ff er Size = 65536 # network buffer size in bytes, if you try to change the low speed. Sometimes to increase the speed it is worth reducing the size of the buffer.
Messages = Standard # indicate the name of the message generation section
Name = agima-sd # name of this storage server
#Pid Directory = / var / lib / bareos # Location of the PID file
#SD Address = 1.2.3.4 9103 # domain name or IP address, port must be specified with a space or in a separate parameter

#SD Addresses = {# To specify several specific domains and / or IP 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 connection
timeout #SD Port = 9103 # port number on which the server will listen
#SD Source Address = # specific (separate) address which listens to the server for communication with the client
#Secure Erase Command = string # parameter to indicate which command to use to permanently delete
#Statistics Collect Interval = 30 # interval for collecting statistics
#Working Directory = / var / lib # working directory
}

Director {# start of the description of the section for connecting to this storage server
Name = agima-dir # indicate the name of the server that can connect to us
Password = "password1" # password with which
Description = will be connected “Backup server” # Server description
#Key Encryption Key = password # data exchange encryption key
#Maximum Bandwidth Per Job = 1 k / s # Maximum channel width for 1 task, speed values ​​k / s, kb / s, m / s or mb / s.
#Monitor = no # Allows full or limited access to the server. Limited access only allows you to view server status.
}

Device {# start of storage location description
Always Open = no; # Always keep the device open
Archive Device = / opt / backup # Save path
#Auto De fl ate = out # The parameter works only when the autox fl ate-sd module is turned on. Values: in - stream compression when reading from the device, out compression when writing to the device, both compression in both cases.
#Auto De fl ate Algorithm = GZIP # GZIP - gzip level 1–9, LZO, LZFAST, LZ4, LZ4HC
#Auto De fl ate Level = 6 # compression level
#Auto In fl ate = in # The parameter works only when the autox fl ate-sd module is enabled. Values: in - stream compression when reading from the device, out compression when writing to the device, both compression in both cases.
#Auto Select = yes # Automatically select this device
#Automatic Mount = yes; # automatically mount the device
#Block Checksum = yes # Enables CRC32 checksum verification, also allows reading broken data
#Check Labels = yes # Enables label verification for non-ANSI records
#Close On Poll = no # remount device
#Collect Statistics = yes # Collect statistics
Description = "Primary raid storage" # Device description
#Device Options = string # device options are used for external Ceph and GlusterFS plugins
Device Type = File # Device type: Tape cassettes; File flash drives, drives, network drives; GFAPI (GlusterFS); Rados (Ceph Object Store); Fifo read-only or write-only sequential access devices.
Label Media = yes; # allow server to set label on blocks / accept Bareos set label unlabeled media
Label Type = primary # label to be set
Maximum Concurrent Jobs = 4 # maximum number of simultaneous tasks
Maximum File Size = 500 Gb # maximum file size
#Maximum Job Spool Size = #Maximum task queue
size #Maximum Network Bu ff er Size = 65536 # network size buffers in bytes, if low speed try changing. Sometimes to increase the speed it is worth reducing the size of the buffer.
Maximum Open Volumes = 1 # maximum number of open volumes
Maximum Open Wait = 15 # maximum device wait time
#Maximum Spool Size = #Maximum volume of the task queue
Media Type = File # is a text parameter where you can freely specify the type of device you like best
#Mount Command = Strname # mount command for this device
#Mount Point = Strname # mount point
Name = AgimaStorage # name of this storage location
Random Access = yes; # indicates support for random access to data, cassettes do not have this capability
Removable Media = no; # indicate whether the device to be disconnected
Requires Mount = no # whether this device needs to be mounted
#Spool Directory = directory # Directory to create temporary files, default working directory
#Unmount Command = Strname # unmount command
#Volume Capacity = # volume size
}

Messages {
Name = Standard # name of the current notification
Description = “Standard messages file daemon” # notification description
#Mail Command = # email sending command, must 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 symbol
# #% c = Client's name \ Client name
##% d = Director's name \ Server name
##% e = Job Exit code (OK, Error, ...) \ End status
##% h = Client address \ client host
# #% i = Job Id \ Task ID
##% j = Unique Job name \ Unique name of the task
##% l = Job level \ priority of the task
##% n = Job name \ Task name
##% r = Recipients \ recipients
##% s = Since time \ # I will be glad if someone explains what this parameter means
##% t = Job type (eg Backup, ...) \ Task Type
##% v = Read Volume name (Only on director side) \ Read a volume with the name
##% V = Write Volume name (Only on director side) \ A volume with the name

#Operator Command = string # has been written should be described before the Operator parameter. Similar to Mail Command, but sends the operator

## Notification types message-type:
## info informational messages
## warning Notifications
## error errors
## fatal errors due to which tasks stop
## terminate messages when the server is disconnected
## notsaved files are not saved
## skipped missing files that were thrown during an incremental backup or other user settings or actions
## mount mounting completed
## restored list of restored files
## all all messages
## security info and warning messages only when trying to connect
## alert messages generated by tape alerts
## volmgmt volume management messages
## audit action

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

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

/etc/bareos/bareos-dir.conf
Storage {
Address = 127.0.0.1 # address to connect to
Allow Compression = yes # Whether to allow compression
#Auth Type = MD5 # authorization method None | Clear | MD5
#Collect Statistics = yes # Whether to collect statistics
Description = “Primary storage” # Description current section
Device = FirstStorage # used device, the value is equal to the name parameter of the device section
Enabled = yes # whether this storage server is
enabled #Maximum Bandwidth Per Job = 1 k / s # Maximum channel width for 1 task, speed values ​​k / s, kb / s, m / s or mb / s.
#Maximum Concurrent Jobs = 1 # maximum number of simultaneous tasks
#Maximum Concurrent Read Jobs = 0 # maximum number of simultaneous tasks
Media Type = File # is a text parameter where you can freely specify the type of device you like most
Name = agima-sd # name of this section
Password = password1 # password to connect to the storage server
#Port = 9103 # port to connect to
}

Catalog {
DB Address = localhost # network address of the
DB database Driver = mysql # Select the DBMS postgresql | mysql | sqlite
DB Name = bareos # Database name
DB Password = “123” # User password for DBMS
DB Port = 3306 # Port on which DBMS works
#DB Socket = string # path to the database socket if we use the
DB socket User = bareos # User subd DBMS
Description = “Catalog metadata for bareos” # Description
Disable Batch Sections Insert = no # Allows multiple inserts
#Exit On Fatal = no # close the program on error
#Idle Timeout = 30 # Communication timeout
#Inc Connections = 1 # If ended free connections, you can add how much is indicated in this parameter
#Max Connections = 5 # Maximum number of connections
#Min Connections = 1 # Minimum number of connections
Name = agima-meta # Name of the current section
Reconnect = yes # Reconnect to the database if the connection is
disconnected #Validate Timeout = 120 # Time to check if the database is working or not
}


We reboot the server and start storage:

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

If there is no connection between them, configure the firewall.

Now we have a server and a place to store backups. The servers are running, but there is no one to do backups. Set up a client who will do backups. The client is the bareos-fd daemon, 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 to wait for the task
#Allow Bandwidth Bursting = yes # allow to increase the channel width
#Allowed Job Command = # Types of allowed commands for this client: backup backups; restore file recovery; verify file verification; estimate check allowed teams; runscript running scripts
#Allowed Script Dir = # Directories from which the client is allowed to run scripts
#Compatible = no # Compatibility mode with bacula
Description = “First client on server example.com” # client description
#FD Address = 1.2.3.4 9102 # domain name or ip address, port must be specified with a space or in a separate parameter
#FD Addresses = {# To specify several specific domains and / or IP 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 the client will listen
#FD Source Address = # specific (separate) address that the client listens on to communicate with the storage server
#Maximum Bandwidth Per Job = 1 k / s # Maximum channel width per task, speed values ​​k / s, kb / s, m / s or mb / s.
#Maximum Concurrent Jobs = 20 # Maximum number of simultaneously executed tasks
#Maximum Network Bu ff er Size = 65536 # size of the network buffer in bytes, if you try to change the low speed. Sometimes to increase the speed it is worth reducing the size of the buffer.
Messages = standard # specify the name of the message generation section
Name = agima-client # Name of this client
#Pid Directory = / var / lib / bareos # Directory for storing the PID file
#Scripts Directory = directory # Directory where the scripts are stored
#SD Connect Timeout = 1800 # Timeout for connecting to the storage server
#Secure Erase Command = string # Permanent delete
command #Working Directory = / var / lib / bareos # Working directory
}

Director {
#Address = 1.2.3.4 # Address to which we connect
#Allowed Job Command = # Types of allowed commands for the server: backup creation of backups; restore file recovery; verify file verification; estimate check allowed teams; runscript running scripts
#Allowed Script Dir = "/ etc / bareos" # Directories from which the server is allowed to run scripts
#Allowed Script Dir = "/ path / that / is / also / allowed" #
Description = "General backup server" # Server description
#Maximum Bandwidth Per Job = 1 k / s # Maximum channel width for 1 task, speed values ​​k / s, kb / s, m / s or mb / s.
#Monitor = no # Allows full or limited access to the server. Limited access only allows you to view server status.
Name = backup-dir # Name of the server that can connect
Password = Md5password # password for connecting to the client encrypted in md5
}

Messages {
Name = Standard # name of the current notification
Description = “Standard messages file daemon” # description of the notification
#Mail Command = # email sending command must be described before the Mail, Mail parameters 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 symbol
##% c = Client's name \ Client name
##% d = Director's name \ Server name
##% e = Job Exit code ( OK, Error, ...) \ Completion status
##% h = Client address \ client host
##% i = Job Id \ Task ID
##% j = Unique Job name \ Unique task name
##% l = Job level \ task priority
##% n = Job name \ Task name
##% r = Recipients \ recipients
##% s = Since time \ # I will I'm glad if someone explains what this parameter means
##% t = Job type (eg Backup, ...) \ Task Type
##% v = Read Volume name (Only on director side) \ Read volume with the name
##% V = Write Volume name (Only on director side) \ A volume with the name

#Operator Command = string # is written must be described before the Operator parameter. Similar to Mail Command, but sends the operator

## Notification types message-type:
## info informational messages
## warning Notifications
## error errors
## fatal errors due to which tasks are stopped
## terminate messages when the server was turned off
## notsaved files were not saved
## skipped missing files that were thrown into exceptions either during incremental backups or other user settings or actions
## mount mounting completed
## restored list of recovered files
## all all messages
## security info and warning messages only when trying to connect
## alert messages generated by tape alerts
## volmgmt volume management messages
## audit messages about actions

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

Hurray, we described the client, now connect it to our server, insert at the end of the bareos-dir.conf file:

/etc/bareos/bareos-dir.conf
Client {
#Allow Client Connect = yes # allow incoming connections from the client
#Auth Type = MD5 # Authorization type None | Clear | MD5
#Auto Prune = no # Automatically clear outdated tasks from the directory
#Catalog = resource-name # directory used for storing metadata
#Description = string # description of this client
#Enabled = yes # whether this client is
included #FD Address = string # address for connecting to the client
#FD Password = password # password for connecting to the client
#FD Port = 9102 # port on which
#File Retention = 5184000 # Duration of storing history of files in the directory
#Hard Quota = 0 # The amount of data available for use, p When exceeded, the task is canceled
#Job Retention = 15552000 # Duration of storing history of tasks in the directory
#Maximum Bandwidth Per Job = 1 k / s # Maximum channel width for 1 task, speed values ​​k / s, kb / s, m / s or mb / s.
#Maximum Concurrent Jobs = 1 # maximum number of simultaneously running tasks
#Name = agima-client # unique name of the client we connect to
#Passive = no # passive mode, incoming connections are unavailable
#Quota Include Failed Jobs = yes # Consider the volume of failed tasks in quotas
#Soft Quota = 0 # The amount of data available for use; if exceeded, the task is not canceled
}


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

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

Now we have everything, but backups are still not done. Add tasks and a schedule for their implementation.

Expand
Pool {
#Action On Purge = Truncate # Trim partitions when cleaning to reduce the occupied volume
Auto Prune = yes # Automatically delete obsolete partitions
Catalog = resource-name # Specify the directory in which to store metadata
Catalog Files = yes # Write file names to the
Description = directory string # Description of the pool
#File Retention = time # How long to keep records of files in the directory
#Job Retention = time # How long to keep records of files in the directory
Label Format = “backup-” # prefix for backup files
#Label Type = ANSI | IBM | Bareos # Prefix type
#Maximum Blocksize = positive-integer # Maximum block size by default 63KB
Maximum Volume Bytes = Size64 # Maximum size of the volume (backup archive file)
Maximum Volume Files = positive-integer # Maximum number of tasks in one volume
Maximum Volume Jobs = positive-integer # Maximum number of tasks in one volume
Maximum Volumes = positive-integer # Maximum number of volumes
Name = agima-pool # Name of this pool
Pool Type = Strname # Pool type Backup, * Archive, * Cloned, * Migration, * Copy, * Save
Purge Oldest Volume = yes # Delete obsolete volumes
Recycle = yes # If there is not enough space , search for obsolete files and volumes and clean them
Recycle Current Volume = yes # Clear the current volume
Recycle Oldest Volume = yes # Clear obsolete volumes
Recycle Pool = resource-name # Clear the pool, allows automatically moving backups to another pool
Scratch Pool = resource-name # Scratch name is reserved for the spare volume pool - if necessary, the system automatically transfers the volume from it to the required pool
Storage = ResourceList # Used storage servers
Use Catalog = yes # Save metadata to the database
Volume Retention = 31536000 # How long to keep records of volumes in the directory
Volume Use Duration = 7 days # How long the volume is writable
}

FileSet {# file set rule
Description = string # Description of current rules
# Enable VSS = yes # Enables shadow copying of volume for Wi ndows
Name = agima-site # unique name of this rule
# Exclude {# indicate which files we exclude
# Options {
# AutoExclude = yes # Used for Windows. Check the registry for excluded files.
# fstype = ext2 # Available file systems for fully copying a disk volume. ext2, jfs, ntfs, proc, reiserfs, xfs, usbdevfs, sysfs, smbfs, iso9660
# sparse = yes # exclude zeros in raw files if they are 32K in a block in a row
# onefs = yes # Use only 1 file system
# signature = MD5 # SHA1 algorithm for checking changes.
# recurse = yes # recursive directory
traversal # noatime = yes # do not change file access time
# mtimeonly = yes # For incremental and differential copying, check only st_mtime. In the off state, it also checks st_ctime.
# keepatime = yes # do not change access time
# check fi lechanges = yes # check file changes
# aclsupport = yes # Support for extended access list for Linux
# xattrsupport = yes # Support for additional file attributes
# ignore case = yes # Do not case sensitive
# DriveType = Windows -drive-type # Used disk type for Windows: removable, fi xed, remote, cdrom, ramdisk
# hfsplussupport = yes # File system support apple

# size =
# - - Select fi le in range size - size. #Size in range
# #> size - Select fi les bigger than size. # Files larger than the specified size
#size - Select fi les which are within 1% of size. # Files of the specified size ± 1%

# verify =
#i compare the inodes # Comparisons of indexes
#p compare the permission bits # Comparison of file
permissions #n compare the number of links # Number of file links
#u compare the user id # Comparison user ID
#g compare the group id # Group ID comparison
#s compare the size # Size comparisons
#a compare the access time # access time comparisons
#m compare the modi fi cation time (st_mtime) # Modification
time comparisons #c compare the change time ( st_ctime) # Change time comparisons
#d report file size decrease # file size change report
# 5 compare the MD5 signature # Compare the hash of the file sums of the MD5
# 1 compare the SHA1 signature # Compare the hash of the file amounts of the SHA1
#A Only for Accurate option, it allows to always backup the file # Accurate option when describing a set of files (allows you to set checksum checks, and not just check file creation / modification times when determining a list of modified files)

# compression = GZIP5 # enable compression GZIP1-9 | LZO | LZFAST | LZ4 | LZ4HC
#}
# File = "| sh -c 'df -l | grep \" ^ / dev / hd [ab] \ "| grep -v \". * / tmp \ "| awk \" {print \\ $ 6} \ "'"
# File = /
# File = / usr
#}
Ignore File Set Changes = no # If the rule changes, the next task that uses it will do a full backup. If you set yes to the next full backup, the old rule will be used.
# Include {# indicate which files we take
# Options {
# File = /
# File = / usr
# Exclude Dir Containing = .nobackup # exclude the directory containing the file
#}
}

Schedule {
Description = string # Schedule description
Enabled = yes # Schedule enable
Name = MonthlyCycle # Unique schedule name
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
# Months jan | feb | mar | apr | may | jun | jul | aug | sep | oct | nov | dec | january | february | ... | december | monthly
# Days of the week sun | mon | tue | wed | thu | fri | sat | sunday | monday | tuesday | wednesday | thursday | friday | saturday | daily
# Week numbers in the month 1st | 2nd | 3rd | 4th | 5th | fi rst | second | third | fourth | fi fth | last
# hours and minutes “at 00:00”
# Week numbers of the year w00 | w01 | ... w52 | w53
# the numbers of days in a month and ranges are available via "-"
}

Job {
Accurate = yes # receives from the director a list of files stored in previous tasks, file systems with a large number of files require a lot of OP on the client
Add Pre fi x = string # Add prefix
Add Su ffi x = string # Add postfix
Allow Duplicate Jobs = yes # Allows duplicate task launch
Allow Higher Duplicates = yes # if duplicates are forbidden, then select the task with the highest priority
Allow Mixed Priority = no # allows the priority task to start , without waiting for the completion of the low priority
Base = ResourceList # for any type of backup, files that have not changed since the time of the basic backup are not duplicated. The name of the task is indicated.
Bootstrap = directory # during backup, information is written to this file that makes it easier to recover files

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

Cancel Lower Level Duplicates = yes # if duplicates are forbidden, then abort the low priority task
Cancel Queued Duplicates = yes # if duplicates are forbidden and the task is already in the queue by the same name, then abort it
Cancel Running Duplicates = yes # if duplicates are prohibited and a task with the same name is already running, then abort it
Catalog = agima-meta # Name of the used directory ha to save metadata
Client = agima-client # On which client to run the task
Client Run After Job = RunscriptShort # Run the script on the client after the task
Run Run Before Job = RunscriptShort # Run the script on the client before the task
Description = string # Task description
Di ff erential Backup Pool = agima -pool # Used pool for differential backup
Di ffrential Max Runtime = time # Maximum time to run diff backup
Enabled = yes # Whether the task is set
File Set = agima-site # Used file set rule
Full Backup Pool = agima-pool # Used pool for full backup
Full Max Runtime = time # Maximum time to complete a full backup
Incremental Backup Pool = agima-pool # Used pool for differential backup
#Incremental Max Runtime = time # Maximum execution time for incremental backup
#Job Defs = resource-name # Presets for describing the task.
#Job To Verify = resource-name # Task for checking the backup
Level = BackupLevel # Sets the level for the type of task: for creating backups VirtualFull | Full | Incremental | Di ff erential, to check InitCatalog check existing files with a list from the directory | Catalog comparing current list and previous | VolumeToCatalog compares file attributes with entries in the directory, and if a hash is written in the directory, the amounts are compared and their | DiskToCatalog is the same as the previous one only for disks, to restore Restore.
Max Concurrent Copies = 100 # The maximum number of simultaneously protected copies of the task
Max Di ff Interval = time # allows you to set the maximum time interval between differential backups; when it is exceeded, the backup of the changes turns into differential backup
Max Full Interval = time # allows you to set the maximum time interval between full backups, when it is exceeded, the backup of the changes turns into a full backup
Max Run Time = time # maximum execution time
Max Start Delay = time # maximum wait queuing for launch
Max Virtual Full Interval = time # allows you to set the maximum time interval between trial full backups; when it is exceeded, the backup of the changes turns into a trial full backup
Max Wait Time = time # waiting for the volume to be installed from the moment it starts
Maximum Bandwidth = k / s # Maximum width channel, speed values ​​k / s, kb / s, m / s or mb / s.
Maximum Concurrent Jobs = 1 # number of simultaneously running tasks
Maxrun Sched Time = time # (Max Start Delay + Max Run Time)
Messages = standard required # Notifications used
Name = agima-site required # Unique task name
#Next Pool = resource-name # destination pool name for the migration job
Pool = agima-pool # Used pool
Prefer Mounted Volumes = yes # minimizes the number of mounts or parallelizes the recording
Pre fi x Links = no # when restoring “out of place” absolute symbolic links are modified according to
Priority = 10 # The priority of the task, the larger the number, the more important. 1-255
Prune Files = no # clear files from the
Prune directory Jobs = no # clear tasks from the
Prune directory Volumes = no # clear volumes from the
Purge directory Job Migration Job = no # Delete the migration task at the end of
Regex Where = string # When restoring
Replace = Always # always - always, ifnewer - if newer, never - never, ifolder - if older When restoring, replace files according to the specified rules
Rerun Failed Levels = yes # increase the priority of the task when restarting
Reschedule Interval = 1800 # restart after the specified interval
Reschedule On Error = yes # Restart the task if the error
Reschedule Times = 5 # number of retry attempts
Run = “Nightly-backup level =% l since = \ "% S \" storage = DDS-4 "# Task name, level, parameters Storage Server
Run Script {
Command =" echo test "# Run command run
When = After # When to launch Never never | Before before | After after | Always always | AfterVSS after shadow copy
Runs On Failure = yes # Run on error
Runs On Client = no # run on client
Runs On Success = yes # Run on success
}
Schedule = MonthlyCycle # Used schedule
Storage = ResourceList # Used storage server
Strip Pre x = string # When restoring, trim the specified
type = JobType # Backup prefix backup, Restore backup recovery, Verify backup verification, Migrate backup backup, Admin starts to automatically clean data in the directory , Copy checking if there is data to copy
#Virtual Full Backup Pool = resource-name # Used pool for full virtual backup
Where = directory # directory where files will be restored
Write Bootstrap = directory # directory for saving files describing
Write Verify List = dire ctory # where to save the verification log
}

Messages {
Name = Standard # name of the current notification
Description = “Standard messages file daemon” # description of the notification
#Mail Command = # email sending command must 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 symbol
##% c = Client's name \ Client name
##% d = Director's name \ Server name
##% e = Job Exit code (OK, Error, ...) \ Completion status
##% h = Client address \ client host
##% i = Job Id \ Task ID
##% j = Unique Job name \ Unique name of the task
##% l = Job level \ priority of the task
##% n = Job name \ Task name
##% r = Recipients \ recipients
##% s = Since time \ # I will be glad if someone explains what this parameter means
##% t = Job type (eg Backup, ...) \ Task type
##% v = Read Volume name (Only on director side) \ Read a volume with the name
##% V = Write Volume name (Only on director side) \ A volume with the name

#Operator Command = string # is written must be described before the Operator parameter. Similar to Mail Command, but sends the operator

## Notification types message-type:
## info informational messages
## warning Notifications
## error errors
## fatal errors due to which tasks stop
## terminate messages when the server is disconnected
## notsaved files are not saved
## skipped missing files that were thrown during an incremental backup or other user settings or actions
## mount mounting completed
## restored list of restored files
## all all messages
## security info and warning messages only when trying to connect
## alert messages generated by tape alerts
## volmgmt volume management messages
## audit action

messages #Append = [address =] message-type [, message-type] * # Adds a message to the file if the file does not exist it will be created
director = backup -dir = all # send a message to the bareos server
#Catalog = # send and messages to the directory database
#Console = # sending a message to the console
#File = # sending a message to a file if the file exists it will be overwritten
#Mail = # sending a message to the specified address
#Mail On Error = # email if error
#Mail On Success = # email if successful
#Operator = # send an email to the specified address to the operator
#Stderr = # send a message to standard error output
#Stdout = # send a message to standard output
#Syslog = # send a message to Syslog journal
}

Certificate authorization is left out of this article, you can always Read official documentation or other manuals online. Accepted comments on the design.

Also popular now: