Difference between revisions of "BackupPC"

From ArchWiki
Jump to: navigation, search
m (Bot: Removing from Category:HOWTOs (English))
(Article-Update after moving the package from AUR to the official repositories)
Line 6: Line 6:
 
==Installation==
 
==Installation==
  
=== Prerequisites ===
+
BackupPC is part of the official repos. You can simply install it with pacman:
==== Packages ====
+
# pacman -S backuppc
The following packages are needed if you want to:
+
* Use rsync as a transport: [http://aur.archlinux.org/packages.php?ID=13251 perl-file-rsyncp] from [[AUR]].
+
* Use compression: [http://aur.archlinux.org/packages.php?ID=12389 perl-compress-zlib] from [[AUR]].
+
* Restore files in Zipped archives: perl-archive-zip
+
  
====Create the the backuppc user====
+
=== Additional Packages ===
useradd backuppc --uid 91 -g nobody --home /home/backuppc --create-home
+
The following packages are available if you want to
{{Note|When installing BackupPC from AUR this isn't necessary since it is handled by the PKGBUILD.}}
+
* Use rsync as a transport: rsync & perl-file-rsyncp
 +
* Use compression: perl-compress-zlib
  
===Install the package===
 
To build [http://aur.archlinux.org/packages.php?ID=13343 BackupPC] from [[AUR]] run as a regular user:
 
wget http://aur.archlinux.org/packages/backuppc/backuppc.tar.gz
 
tar -zxf backuppc.tar.gz
 
cd backuppc
 
makepkg
 
  
When done run as root:
 
pacman -U backuppc-version-arch-pkg.tar.gz
 
chown -R backuppc:nobody /var/log/BackupPC
 
 
==Running BackupPC==
 
 
===Start BackupPC===
 
===Start BackupPC===
 
To manually start BackupPC issue this command.
 
To manually start BackupPC issue this command.
  /etc/rc.d/backuppc start
+
  # /etc/rc.d/backuppc start
  
 
===Make BackupPC run at startup===
 
===Make BackupPC run at startup===
 
To make BackupPC load at startup edit /etc/rc.conf and add it to DAEMONS.
 
To make BackupPC load at startup edit /etc/rc.conf and add it to DAEMONS.
  nano /etc/rc.conf
+
  # nano -w /etc/rc.conf
 
  DAEMONS=(... backuppc ...)
 
  DAEMONS=(... backuppc ...)
  
 
==Apache Configuration==
 
==Apache Configuration==
BackupPC has a web interface that allows you to control it. It required Apache and mod_perl.
+
BackupPC has a web interface that allows you to easily control it. It requires Apache and mod_perl.
  
 
===Install Apache and mod_perl===
 
===Install Apache and mod_perl===
  pacman -S apache
+
  # pacman -S apache mod_perl
pacman -S mod_perl
+
  
 
===Edit Apache configuration===
 
===Edit Apache configuration===
You can edit the [[Apache]] configuration file to change the port number, etc.
+
Edit the Apache configuration file...
  nano /etc/httpd/conf/backuppc-httpd.conf
+
  # nano -w /etc/httpd/conf/httpd.conf
 +
 
 +
...to load mod_perl, tell Apache to run as user backuppc and to include /etc/httpd/conf/extra/backuppc.conf
 +
 
 +
LoadModule perl_module modules/mod_perl.so
 +
User backuppc
 +
Include conf/extra/backuppc.conf
  
 
Edit /etc/BackupPC/config.pl. Set administrator name
 
Edit /etc/BackupPC/config.pl. Set administrator name
 
  $Conf{CgiAdminUsers} = 'admin';  
 
  $Conf{CgiAdminUsers} = 'admin';  
Next, we need to add a users file. Edit /etc/httpd/conf/backuppc-httpd.conf
+
Next, we neet to add a users file and set the admin password:
AuthName "Backup Admin"
+
  # htpasswd -c /etc/backuppc/backuppc.users admin
AuthType Basic
+
AuthUserFile /etc/BackupPC/BackupPC.users
+
Require valid-user
+
 
+
Set admin password
+
  htpasswd -c /etc/BackupPC/BackupPC.users admin
+
  
Add following lines if you already use apache before
+
{{Note|The BackupPC-Webfrontend is initially configured, that you can only access it from the localhost. If you want to access it from all machines in your network, you have to edit /etc/httpd/conf/backuppc.conf:}}
LockFile "/var/lock/backuppc-httpd.lock"
+
  # nano -w /etc/httpd/conf/backuppc.conf
  PidFile "/var/run/httpd/backuppc-httpd.pid"
+
Edit the line
 +
allow from 127.0.0.1
 +
to
 +
allow from 127.0.0.1 192.168.0
 +
where you have to replace 192.168.0 to your corresponding IP-Adresses you want to gain access from.
  
===Starting Apache manually===
+
===Starting BackupPC and Apache manually===
  /etc/rc.d/backuppc-httpd start
+
  # /etc/rc.d/backuppc start
 +
# /etc/rc.d/httpd start
  
===Starting Apache on boot===
+
===Starting both on boot===
Add the backuppc-http daemon to rc.conf
+
Add the BackupPC and the Apache daemon to rc.conf
  nano /etc/rc.conf
+
  # nano -w /etc/rc.conf
  DAEMONS=(... backuppc-httpd ...)
+
  DAEMONS=(... backuppc httpd ...)
  
Browse to http://localhost:81/cgi-bin/BackupPC_Admin
+
Browse to http://localhost/BackupPC_Admin respectively http://YOUR_BACKUPPC_SERVER_IP/BackupPC_Admin
  
 
==Resources==
 
==Resources==
 
* [http://backuppc.sourceforge.net/index.html BackupPC Home Page]
 
* [http://backuppc.sourceforge.net/index.html BackupPC Home Page]
 
* [http://backuppc.sourceforge.net/faq/BackupPC.html BackupPC Documentation]
 
* [http://backuppc.sourceforge.net/faq/BackupPC.html BackupPC Documentation]

Revision as of 09:04, 22 February 2012

BackupPC is a high-performance, enterprise-grade system for backing up Unix, Linux, WinXX, and MacOSX PCs, desktops and laptops to a server's disk. BackupPC is highly configurable and easy to install and maintain.

Given the ever decreasing cost of disks and raid systems, it is now practical and cost effective to backup a large number of machines onto a server's local disk or network storage. For some sites this might be the complete backup solution. For other sites additional permanent archives could be created by periodically backing up the server to tape.

Installation

BackupPC is part of the official repos. You can simply install it with pacman:

# pacman -S backuppc

Additional Packages

The following packages are available if you want to

  • Use rsync as a transport: rsync & perl-file-rsyncp
  • Use compression: perl-compress-zlib


Start BackupPC

To manually start BackupPC issue this command.

# /etc/rc.d/backuppc start

Make BackupPC run at startup

To make BackupPC load at startup edit /etc/rc.conf and add it to DAEMONS.

# nano -w /etc/rc.conf
DAEMONS=(... backuppc ...)

Apache Configuration

BackupPC has a web interface that allows you to easily control it. It requires Apache and mod_perl.

Install Apache and mod_perl

# pacman -S apache mod_perl

Edit Apache configuration

Edit the Apache configuration file...

# nano -w /etc/httpd/conf/httpd.conf

...to load mod_perl, tell Apache to run as user backuppc and to include /etc/httpd/conf/extra/backuppc.conf

LoadModule perl_module modules/mod_perl.so
User backuppc
Include conf/extra/backuppc.conf

Edit /etc/BackupPC/config.pl. Set administrator name

$Conf{CgiAdminUsers} = 'admin'; 

Next, we neet to add a users file and set the admin password:

# htpasswd -c /etc/backuppc/backuppc.users admin
Note: The BackupPC-Webfrontend is initially configured, that you can only access it from the localhost. If you want to access it from all machines in your network, you have to edit /etc/httpd/conf/backuppc.conf:
# nano -w /etc/httpd/conf/backuppc.conf

Edit the line

allow from 127.0.0.1

to

allow from 127.0.0.1 192.168.0

where you have to replace 192.168.0 to your corresponding IP-Adresses you want to gain access from.

Starting BackupPC and Apache manually

# /etc/rc.d/backuppc start
# /etc/rc.d/httpd start

Starting both on boot

Add the BackupPC and the Apache daemon to rc.conf

# nano -w /etc/rc.conf
DAEMONS=(... backuppc httpd ...)

Browse to http://localhost/BackupPC_Admin respectively http://YOUR_BACKUPPC_SERVER_IP/BackupPC_Admin

Resources