Deploying Suse Linux Enterprise Server
| Purchase "Deploying Suse Linux Enterprise Server" at Lulu.com |
Deploying BackupPC on SLES
- Introduction
- Installing and Configuring SLES for BackupPC
- Installing BackupPC
- Configuring Clients to Backup
- Working with the Web Interface
- Configuring BackupPC for Archiving Clients
- Finishing Up
Configuring Clients to Backup
To get BackupPC to actually do the work you need - Backing up computers - you need to configure the "Client Computers" so BackupPC can access all of the files that need to be backed up. Each client operating system has a different way of allowing this communication and this section will cover the various options for each operating system.
Note on backing up clients: The biggest issue when backing up Clients when using either the "Rsync" or the "Rsyncd" XferMethod is the fact that unfortunately, not many networks have a properly working DNS server. If you are able to connect to the client machine with SSH by using the computer name, you should not have an issue with backing up the computer. If you can not connect to the client machine by simply using the hostname, you will want to either properly configure a DNS server for your network, or simply add the client's hostname (along with it's IP Address) to the /etc/hosts file on the BackupPC Server.
Backing Up Linux Clients
The best way to backup Linux or Unix based clients is to use the rsync program tunneled through the Secure Shell program (SSH). To do this you have to configure SSH to automatically allow commands to be ran remotely from the BackupPC computer.
SSH Key-Exchange
Note: These instructions should work for most Linux Distributions, although for some Distributions you may need to make some slight modifications to these instructions.
First you will want to "login" as the backuppc user that we created earlier. For security reasons you do not want to allow that username to simply login at any prompt, so an alternative way to login as the backuppc user is to first login as the root user, then to "switch-user" to the backuppc user.
su -s /bin/bash backuppc cd pwd
The cd command will switch to backuppc's "home" directory, which is whatever you entered when you created the backuppc user, I usually use /srv/backuppc on SLES computers. The pwd command will simply list the "present working directory" that you are in. This ensure that we are in fact in the backuppc user's home directory.
Now that we are logged in as the backuppc user, we will want to create a new SSH key pair that we will use to allow the backuppc user remote access to the machines we are going to backup. To do this simply type in the following command:
ssh-keygen -b 2048 -t rsa chmod -R go-rxw .ssh/* cp .ssh/id_rsa.pub BackupPCkey.pub
Now that you have created the SSH key and copied the id_rsa.pub key to BackupPCkey.pub, now you will want to copy that pub key to every Linux machine you want to backup. So for every client you will want to execute the following commands:
sftp root@clientmachine put BackupPCkey.pub exit ssh root@clientmachine ssh-keygen -b 2048 -t rsa cat BackupPCkey.pub >> .ssh/authorized_keys2 chmod -R go-rxw .ssh/*
Finally, you will want to make sure everything went well when exchanging SSH Keys.
ssh -l root clientmachine whoami
The above command should return "root".
Configuring BackupPC to backup the Linux Client
Now that you have the SSH Keys working correctly, you now have to configure BackupPC to backup the client machine.
BackupPC will read the default settings in /etc/BackupPC/config.pl to backup any machine you have listed in the /etc/BackupPC/hosts file. By default, BackupPC will attempt to backup the client machine using the smbclient, which is only suitable when backing up Windows based clients. To change the default behavior you need to create a "per client" configuration that BackupPC will use, overriding the defaults in /etc/BackupPC/config.pl file.
First, you will need to create a directory that you will store all of the per pc configurations. So, as root create the following directory:
mkdir /etc/BackupPC/pc
Now you will want to create a file within that directory for the client you are backing up. So create the file /etc/BackupPC/pc/clientname.pl and add the following to it:
$Conf{XferMethod} = 'rsync';
$Conf{RsyncShareName} = [ '/etc', '/home', '/srv', '/var' ];
Where $Conf{RsyncShareName} is a list of directories that will be backed up on the client computer. Once you created the clientname.pl file, you must add the clientname to the /etc/BackupPC/hosts file (along with any username you want to have access to it's backups) and restart the BackupPC daemon. Note that you can now add the host to the hosts file by using the Web Interface's "Edit Hosts" link on the Server's Status Page. Once this is done, restart the backuppc process and the client should be added to the list of Hosts available in the Web Interface.
| Purchase "Deploying Suse Linux Enterprise Server" at Lulu.com |

