|Backup with BackupPC|
|Written by Administrator|
|Sunday, 10 February 2008 14:38|
I used to backup my systems with "dump" for a long time. When I decided to switch over to ReiserFS "dump" was no longer an option. I then used "amanda" for a couple of years in corporation with a tape device. Since USB harddisks had become cheaper and cheaper, I no longer wanted to rely on slow and expensive tape devices. In order to find a new backup solution, I conducted an evaluation with a winner, finally: BackupPC
BackupPC is an excellent, freely available backup software, written in Perl, with a well arranged web-based front end. It runs on Linux or any UNIX based operating system. No specific client software is necessary to perform client backups on the forenamed operating systems, including windows. BackupPC extracts backup data via SMB using Samba. Tar can be used natively or over ssh/rsh/nfs, or rsync. It is published under the GNU General Public License.
I don't want to go to much into details here. There is an excellent online documentation and instructions that come with the tarball. There are some prerequisites (see above) prior to installation. Some specifics will be covered below.
Slackware specific constraints
At the time I installed BackupPC for the first time and wrote installation instructions for myself, Slackware offered no mod_perl enabled apache web server. If this still is true, you are on your own - I stronlgy recommend to use a perl enabled apache web server. Be aware that instructions below are for apache 1.3.xx numbered web servers.
In addition, apache should run under a specific _BackupPC_ user (see installation instructions). If your apache should serve other things, this might interfere with your security precautions, especially when serving for external access. To meet these concerns, I recommend to run a dedicated apache (httpd) instance with its own configuration file. To do so you can use the "-f" and "-d" options - see apache online documentation and man page. Or you can build a special apache Slackware package by following the instructions and using the layout file below. Up to you - several roads lead to Rom.
Special apache layout
I use a special apache layout file for my dedicated BackupPC apache - adapt the path to whatever fits your needs. The file is called "config.layout.slack".
# Layout for Slackware Linux
Perl enabled apache web server
1. Get the latest mod_perl source code
2. Get the latest apache source from a Slackware mirror. Use the latest version that fits your Slackware release. You will find the apache sources in tree "n" - for an explanation of the Slackware tree see the opening article in the Slackware section. If there had been security issues with apache, the latest version could also be in the "patches" directory.
3. Copy the mod_perl tar.gz file in the local apache source tree. You should now have a variety of files in the local apache source tree, correspondingly:
4. Extract apache and mod_perl archive
5. Configure mod_perl with the string shown below. Be sure to adapt the apache version as necessary. After "configure", type "make". You do not have to install "make install" mod_perl. In case of doubt check for the presence of a perl directory in the apache source "./src/modules/". There should be a perl subdirectory with files in it.
perl Makefile.PL \
6. Re-create the apache archive (apache_1.3.34.tar.gz). This archive contains now the mod_perl files for your mod_perl enabled webserver.
7. Insert the following string in the "apache.SlackBuild" file:
Change manual patch accordingly.
The modified configure section goes like this:
8. Copy modified "apache.SlackBuild" and "config.layout.slack" in the local apache source tree (of not already done so).
9. Execute ./apache.SlackBuild - this creates the mod_perl enabled apache web server in /tmp. Install this package with "installpkg"
10. Adjust httpd.conf to use with BackupPC. See special section in this article.
11. Fire up apache to use with BackupPC.
Apache configuration file
Go trough your httpd.conf file and adjust as needed. Below some options you definitely want to take care of.
The port you want to run apache under. Only specify if not the default port.
The user and group to run apache under.
The document root. Make sure to change all paths throughout the hole configuration file accordingly.
Location of log files.
ScriptAlias /cgi-bin/ "/var/www/backuppc_apache/cgi-bin/"
And finally, include the following at the end of your config file.
# mod_perl Setup
BackupPC configuration file
The file is called "config.pl". I do not want to go trough the file here, this would be beyond the scope of this article. Just make sure you define which hosts and what to backup. You should consider to define your own small backup strategy and write it down. In this context, you should be confident with:
The options are generally quite good documented in the config file itself. If that's not enough, go to the BackupPC website.
BackupPC startup script
This is the BackupPC init script I use. Please adapt:
A full backup is a complete backup of a share. BackupPC can be configured to do a full backup at a regular interval
An incremental backup is a backup of files that have changed since the last successful full or incremental backup
When a full backup fails or is canceled, and some files have already been backed up, BackupPC keeps a partial backup containing just the files that were backed up successfully
BackupPC pools identical files using hardlinks. Identical files are files with identical contents, not necessary the same permissions, ownership or modification time. Two files might have different permissions, ownership, or modification time but will still be pooled whenever the contents are identical. This is possible since BackupPC stores the file meta-data (permissions, ownership, and modification time) separately from the file contents
Based on your site's requirements you need to decide what your backup policy is. BackupPC is not designed to provide exact re-imaging of failed disks.
|Last Updated on Monday, 11 June 2012 10:23|