View Source

{toc:location=top|maxLevel=3|minLevel=3|type=flat|separator=pipe|style=border:1}
----
{tip:title=Video}To watch a video explaining how to set up the backup agent using CentOS, [click here|https://www.youtube.com/watch?v=d01lhTonigw].{tip}


h3. 1. Installing Backup Agent Using YUM

h4. 1.1 Configure YUM Repository

*YUM* is the easiest way to keep programs up-to-date on RedHat-compatible distributions. It downloads and installs the latest version of a program. Configure the *YUM repository* to manage install and [upgrades|Upgrade Backup Agent for Linux] of the Backup Agent.

First, create a YUM {{.repo}} file with the R1Soft repository information. Save the file in the {{yum.repos.d}} directory which is typically located in {{/etc/}}.

1. Open the new file with a text editor such as *vi* or *nano*:

{code}cd /etc/yum.repos.d
vi r1soft.repo{code}
or
{code}nano -w /etc/yum.repos.d/r1soft.repo{code}

!nano-w.png|border=1!


2. Insert the following text into the file and save the file:

{code}[r1soft]
name=R1Soft Repository Server
baseurl=http://repo.r1soft.com/yum/stable/$basearch/
enabled=1
gpgcheck=0{code}

!repo-file.png!

3. To verify what is written to the file, use the following command:

{code}cat /etc/yum.repos.d/r1soft.repo{code}


!cat-etc.png!


h4. 1.2 Install the Package

Once you have configured the YUM repository, you can use the following command to install the Backup Agent:

{note:title=Note}
Note that with the product name change from "CDP" to "Server Backup," the RPM package name changed.


{note}
{code}yum install serverbackup-enterprise-agent{code}
!yum-agent_5.2.0.png|border=1!
Then, enter "y" to install all the dependencies of the package.

!yum-agent-y_5.2.0.png!


----
h3. 2. Install the Backup Agent Manually (Using RPM)

h4. 2.1 Download the Backup Agent

See [Obtain Linux Backup Agent].


h4. 2.2 Make Sure You Can Unzip the Download

Most Linux distributions come with the *unzip* utility pre-installed. To determine if you have the *unzip* utility, run:

{code}which unzip{code}

This command returns an output similar to the following:

{code}which unzip
/usr/bin/unzip{code}

!which-unzip1.png!

If it returns the following output, you need to install the *unzip* utility first:

{code}/usr/bin/which: no unzip in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin){code}
  !which-unzip.png!

 To install unzip on RHE, CentOS, and Fedora:

{code}yum install unzip{code}

!yum-install-unzip.png!


h4. 2.3 Extract the ZIP File

We recommend creating a temporary directory to which you can extract the contents of the ZIP file.


1. Use the {{mkdir}} command to create a temporary directory (in our case, {{serverbackup-enterprise-agent}}).

{code}mkdir serverbackup-enterprise-agent{code}

2. Use the {{mv}} command to move the archive to that directory. Note that Linux file names are case sensitive. Make sure you type the name correctly (in our case, "*serverbackup-enterprise-agent-linux32.zip*").

{code}mv ServerBackup-Enterprise-Agent-linux32.zip serverbackup-enterprise-agent{code}

3. Use the {{cd}} command to go to that directory.

{code}cd serverbackup-enterprise-agent{code}
!mk-agent.png|border=1!
 
4. Use the {{unzip}} command to extract the files.

{code}unzip ServerBackup-Enterprise-Agent-linux32.zip{code}
!unzip-agent_x32_5.2.0.png!




h4. 2.4 Install the Package

The archive you have extracted contains two folders: one with {{.deb}} packages (in our case, "*agent-deb-linux64*") and one with {{.rpm}} packages ("*agent-rpm-linux64*"). On RedHat and CentOS, select the {{.rpm}} package.

Each folder contains a set of the Server Backup components:

* {{serverbackup-setup}}
* {{serverbackup-agent}}
* {{serverbackup-async-agent-2-6}}
* {{serverbackup-enterprise-agent}}

You will need to install all of them in one step. Use the {{cd}} command to go to the folder with the packages (in our case, {{rpm-linux64}}) and run the following command:

*RPM 32-bit (x86)* / *RPM 64-bit (x86_64)*

{code}rpm -i *.rpm{code}
!rpm-i.png|border=1!




----
h3. 3. Install Server Backup Linux Device Driver

Server Backup Device Driver is a proprietary, loadable Linux kernel module distributed by R1Soft. It is loadable at run-time without restarting Linux, and you do *not* need to recompile your Linux kernel to use it. R1Soft does not provide prebuilt modules for the popular kernels anymore, so you will have to compile the module from source.

{note:title=Notice}You need to have loadable modules enabled as a feature in your kernel, and this is standard on all popular Linux distributions.
{note}

h4. 3.1 Compiling Server Backup Kernel Module Against Kernel Source Tree

You will have to compile the kernel module using the kernel headers. The program {{serverbackup-setup}} will obtain all the information needed to compile a module from your running kernel.

In order for kernel module compilation to work, you must have Internet connectivity directly from the Linux server you are installing Server Backup on, to TCP port HTTPS (443), on the host {{krnlbld.r1soft.com}}.

You can test connectivity with the following command (this may take a minute):

{code}serverbackup-setup --test-connection{code}
!test-connection1.png!\\

h4. 3.2 Install Kernel Sources

If you are using an unmodified kernel provided by CentOS installer, install the kernel-devel package:

{code}yum install kernel-devel{code}

!yum-kernel1.png!

h4. 3.3 Verify that the Source Matches Your Running Kernel

Sometimes, the kernel-devel package is newer than the installed and running kernel. If the running kernel is not the latest version and the matching kernel-devel package cannot be found, please follow the instructions on how to setup access to older yum packages as documented [here|kb3:Finding Old kernel-devel Packages For CentOS].

h4. 3.4 Build Server Backup Kernel Module Online (direct Internet connection to R1Soft build server)

To attempt to build the kernel module, run the following command (this may take several minutes):

{code}serverbackup-setup --get-module
{code}

!get-module.png!

If module has been compiled and installed successfully, you will see an output similar to the following:

{code}Saving kernel module to '/lib/modules/r1soft/hcpdriver-cki-2.6.32-279.14.1.el6.i686.ko'
Kernel module is now installed.
Use '/etc/init.d/cdp-agent restart' to load the new driver
{code}

h4. 3.5 Build Server Backup Kernel Module Offline (without direct Internet connection to R1Soft build server)

If there is no direct Internet connection between your server and the R1Soft build server, it is still possible to compile the kernel module. In this case, this is a three-step process. First, create a tarball file with the kernel headers. Copy this tarball file from the server to some other computer which has Internet connection to the R1Soft build server. From this computer you can upload the tarball to the build server and wait for the compilation to finish. When it is finished, download the binary module and copy it back to the server Backup Agent runs on. Start with executing the following command:

{code}serverbackup-setup --no-binary --kernel-dir /usr/src/kernels/YOUR_KERNEL_TREE --tarball-only /tmp/kernel-headers-for-r1soft.tar.gz{code}

After running this command, you will see:

{code}serverbackup-setup \--no-binary \--kernel-dir /usr/src/kernels/2.6.32-279.14.1.el6.i686/
--tarball-only /tmp/kernel-headers-for-r1soft.tar.gz
Gathering kernel information
Gathering kernel information complete.
Creating kernel headers package
Checking '/usr/src/kernels/2.6.32-279.14.1.el6.i686' for kernel headers
Found headers in '/usr/src/kernels/2.6.32-279.14.1.el6.i686'
Compressing...
Header package created '/tmp/kernel-headers-for-r1soft.tar.gz'
visit [https://krnlbld.r1soft.com/] to do an offline module build
After it is complete, you will need to copy the module to /lib/modules/r1soft{code}

!no-binary1.png!

h4. Last Step

* Copy the generated {{tar.gz}} file to a computer with Internet access.
* Go to [https://krnlbld.r1soft.com/] and upload the {{.tar.gz}} file to build a kernel module.
* After the build, you will download a kernel module.
* Copy this module to your Linux Server and place it in the folder {{/lib/modules/r1soft}}.
* Restart the Agent ({{/etc/init.d/cdp-agent restart}}).


{excerpt:hidden=true}Instructions on how to install the Backup Agent on CentOS, RHE, and Fedora.{excerpt}