Section 5.3. Installation How-To


5.3. Installation How-To

The BackupPC server runs on Unix or Linux under the Apache web server using mod_perl, which are not difficult requirements. The BackupPC server is not designed to run under Windows because Windows filesystems do not readily support Unix-style hard links.

Prerequisites dictate how the backups are performed. Table 5-1 lists the high-level requirements and suggestions for tools that can meet the requirements.

Table 5-1. BackupPC requirements
FunctionSuggested toolNeeded forOther toolsNotes
HTTP serverApacheControl GUIAny CGI-capable HTTP server 
CGI
mod_perl

Speed Optional
PerlPerl 5.8Server written in Perl  
tar GNU tar Archive files in a tar container for transferring to serverAny command-line tar programIf tar method is used
rsync

GNU rsync Transport from client to serverAny command-line rsync programIf rsync method is used
smbclient

Samba Transport from client to server If SMB method is used
ssh

OpenSSHTransport layer If tar or rsync methods are used


The amount of disk space needed depends on the amount and type of the data to be backed up. The more diverse the data, the more disk space is needed. A RAID subsystem is not required, but it would be a good idea for performance, data protection and scalability reasons.

The server doesn't need anything more than a 1.5 GHz processor with at least 512 MB of RAM. Since much of the backup computation is compression, more memory and a faster processor are needed for large numbers of clients. Of course, faster disk technologies and clean networks also improve performance.

5.3.1. Security Versus Ease of Use

As is often the case, there is a trade-off between ease of use and security. For a home installation, ease of setup is usually a higher priority than security. The opposite may be true for a division of a global company.

The default configuration has the BackupPC service running as its own user on the server machine and using preshared ssh keys without passwords to connect to the clients as root, or SMB using a password in the case of Windows. This may not fit with local site security policies. Other options include setting up an rsync server on the client using stored passwords, or a two-step process of ssh to a low-privileged client account followed by sudo with a configuration that allows only rsync (or tar) to be executed.

All of the BackupPC processes on the server run as one user ID. This user ID should have limited privileges on the system. The install process ensures the chosen user ID has the correct permissions on the data storage areas. If a new user ID is used, setting up the web interface requires a few extra steps. If the existing ID of the web server is used, there are fewer setup steps, but the system will be less secure. If you use a new user ID, create it before starting the install process.

5.3.2. Basic Sizing

The amount of space needed is highly dependent on the number and type of clients being backed up. The more homogeneous the clients, the more effective the disk pooling is, and the less disk you need. The more diverse the clients, the less effective the disk pooling is, and more space is needed. Additionally, if the data is relatively static, less space is needed for the incrementals. With a lot of data change, the incrementals are larger.

The retention policy also affects storage requirements; more full backups and longer retention times naturally increase storage requirements.

What NIS+?

A client called me after he'd had some problems with NIS+. The manager there (engineer, not IT) wanted to clean up unwanted files on his /var partition and found some handy "log" files to delete. (He removed the transaction logs for NIS+ on the NIS+ master.) NIS+ immediately recognized the fact that its transaction logs were no longer there and stopped.

When I got on-site, I asked the backup administrator for the backup tapes. They did weekly fulls and no incrementals. I found that all four weeks of tapes were incomplete; they'd been getting errors on backup for more than six weeks and hadn't done anything about it.

I had to recreate the databases from whatever information I could find and fix the problem with their backup script. I also changed the output of the backup script so that it yelled a little louder when it had errorshopefully loud enough to not be completely ignored.

Michael Rice


To determine the amount of space needed for backups, add up the disk usage of each client, then multiply by the number of full backups configured. The resulting number is the amount of space required for the full backups (prior to pooling and compression). Next, estimate what percentage of data will change for each incremental. Multiply this by the total amount of data, then by the number of incrementals configured. Add this to the number for the full backups. Compression and disk pooling reduce storage requirements by a factor of six to eight, so divide the total by this factor. To provide headroom as client storage grows and as more clients are added, you might want to start with two to three times this amount of storage.

For example, consider 100 laptops backing up user data that averages 4 GB per client, with each incremental averaging about 0.4 GB. Storing 3 weekly full backups takes around 1,200 GB, and 6 incremental backups takes another 240 GB for a total of 1,440 GB of raw data. Because of pooling and compression, approximately 180240 GB of storage are needed. To support growth of the user data or additional clients, 500 GB or greater capacity should be sufficient for current and future needs.

Because BackupPC uses hard links to compactly store identical files, the entire data store must be on a single filesystem. Using a RAID array or LVM setup allows this filesystem to be expanded over time as needed.

5.3.3. Installing BackupPC

Once the server is identified, and the prerequisites are installed and verified to work, it is time to get down to business. Head over to http://backuppc.sourceforce.net/, and download the latest tar ball. Do not use the beta unless there is a specific need for it. If there is a patch file, download it as well.

Move the tar ball into a working directory and unpack it. Change the directory to the newly created directory. If you have a patch file to apply, do that now:

$ patch -p0 < [path to patchfile]

Something went wrong if you see an error message like Hunk #1 FAILED at 58, and you should verify that the patch-file version matches the distribution you downloaded. If you are still unsuccessful, search or contact the mailing list for help (see the section "The BackupPC Community" at the end of this chapter for details).

The next logical step is to read the README file for any details that may have changed for this release. In addition, there is up-to-date and complete documentation in the doc/ subdirectory.

Read through the BackupPC.html file, and note the specific requirements listed in the installation section. Generally, a few Perl modules need to be installed depending on how the system is configured.

Now, run the following command as root:

# perl ./configure.pl

This process inspects the system and asks for some installation information:


Full path to existing conf/config.pl

This is only used for upgrades. Press Enter for a new install.


Are these paths correct?

Verify that the list of programs have been fully qualified. If a program is not found but you are not planning to use it, it is safe to ignore it. If all the needed programs are listed, press Y; if there is a critical program missing, press Ctrl-C to stop the installation. Fix the problem and rerun the configuration script.


BackupPC will run on host

The script guesses the hostname. Correct as needed.


BackupPC should run as user

This is the user ID that all of the BackupPC processes will run as on the server. Either create a user with no special privileges or choose one with limited privileges.


Install directory ( full path)

This is where the BackupPC program and library files will be stored.


Data directory

This is where the data store will be located. This should be on its own partition and preferably on its own disk or RAID array.


Compression level

This the amount of compression used to store the backups. There is a trade-off between the amount of compression and speed. This value should be from 0 to 9, with 0 being no compression and 9 being the highest amount of compression with the most CPU usage. The default, 3, is a good middle ground.


CGI bin directory

The full path to the web server's CGI bin.


Apache image directory

This directory will hold the image files for the web GUI. It should be a directory that the web server can display.


URL for image directory (omit http://host; starts with "/")

This is what the last part of the URL needs to be to display something placed in the image directory.

At this point, most of the questions should be answered. The script asks whether you want to continue before actually modifying the system. Answering y here allows the script to create the necessary directory structure and installs the scripts to run. As with any install script, watch the output for any errors. Several init scripts are updated with settings based on the configuration responses but are not automatically installed. These scripts are located in the init.d subdirectory where the configure script was run. Copy the correct one into the correct location for starting the service on boot.

Note that starting in version 3.0 of BackupPC, the configure.pl script complies with the Filesystem Hierarchy Standard (FHS). One change is that all the configuration files are by default stored below /etc rather than below the data store. As described earlier, any of the default locations can be changed when running the configure script. If you are upgrading for the first time to version 3.0 or later, the configure.pl script continues to use the original locations for the data store, configuration files, and program executables.

5.3.3.1. Installation packages

An alternative to the manual installation procedure described here is to find and install a BackupPC package specific to your operating system. Packages exist for Debian, Ubuntu, Gentoo, and others. For example, BackupPC can be installed on Debian with:

# apt-get install backuppc 




Backup & Recovery
Backup & Recovery: Inexpensive Backup Solutions for Open Systems
ISBN: 0596102461
EAN: 2147483647
Year: 2006
Pages: 237

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net