Difference between revisions of "BackupPC"

From SME Server
Jump to navigationJump to search
m (Fix Bugzilla link)
Line 25: Line 25:
 
A clever pooling scheme minimizes disk storage and disk I/O. Identical files across multiple backups of the same or different PCs are stored only once resulting in substantial savings in disk storage and disk I/O.
 
A clever pooling scheme minimizes disk storage and disk I/O. Identical files across multiple backups of the same or different PCs are stored only once resulting in substantial savings in disk storage and disk I/O.
  
One example of disk use: 95 latops with each full backup averaging 3.6GB each, and each incremental averaging about 0.3GB. Storing three weekly full backups and six incremental backups per laptop is around 1200GB of raw data, but because of pooling and compression only 150GB is needed.
+
One example of disk use: 95 laptops with each full backup averaging 3.6GB each, and each incremental averaging about 0.3GB. Storing three weekly full backups and six incremental backups per laptop is around 1200GB of raw data, but because of pooling and compression only 150GB is needed.
  
 
Optional compression support further reducing disk storage. Since only new files (not already pooled) need to be compressed, there is only a modest impact on CPU time.
 
Optional compression support further reducing disk storage. Since only new files (not already pooled) need to be compressed, there is only a modest impact on CPU time.
  
No client-side software is needed. The standard smb protocol is used to extract backup data on WinXX clients. On linux clients, tar over ssh/rsh/nfs is used to backup the data. With version 2.0.0, rsync is also supported on any client that has rsync or rysncd.
+
No client-side software is needed. The standard smb protocol is used to extract backup data on Windows clients. On linux clients, tar over ssh/rsh/nfs is used to backup the data. With version 2.0.0, rsync is also supported on any client that has rsync or rysncd.
  
 
A powerful web (http/cgi) user interface allows administrators to view log files, configuration, current status and allows users to initiate and cancel backups and browse and restore files from backups.
 
A powerful web (http/cgi) user interface allows administrators to view log files, configuration, current status and allows users to initiate and cancel backups and browse and restore files from backups.
Line 41: Line 41:
 
Users are sent periodic email reminders if their PC has not recently been backed up. Email content, timing and policies are configurable.
 
Users are sent periodic email reminders if their PC has not recently been backed up. Email content, timing and policies are configurable.
  
Tested on Linux, Freenix and Solaris hosts, and Linux, Win95, Win98, Win2000 and WinXP clients.
+
Tested on Linux, Freenix and Solaris hosts, and Linux, Windows 95, Windows 98, Windows 2000, Windows XP, and Windows Vista clients.
  
 
Detailed documentation.
 
Detailed documentation.
  
Open Source hosted by SourceForge and freely availble under GPL.
+
Open Source hosted by SourceForge and freely available under GPL.
  
 
=== Requirements ===
 
=== Requirements ===
Line 55: Line 55:
 
*Mount a volume on /var/lib/BackupPC
 
*Mount a volume on /var/lib/BackupPC
  
This part is optionnal but highly recommanded. Backups should allways be on a separate volume.
+
This part is optional but highly recommended. Backups should always be on a separate volume.
First, prepare your hard drive for ext3 fs (you can use any fs which support hardlinks, I allways use ext3 as it's verry reliable)
+
First, prepare your hard drive for ext3 fs (you can use any fs which support hardlinks, I always use ext3 as it's very reliable)
 
In this example, I use a simple partition /dev/sdb1, it could also be a RAID array (/dev/md3) or a LVM logical volume (or a combination of RAID and lvm).
 
In this example, I use a simple partition /dev/sdb1, it could also be a RAID array (/dev/md3) or a LVM logical volume (or a combination of RAID and lvm).
By the way, if you know how to manage LVM, its usage is also recommanded as it'll be easier to manage backups data later.
+
By the way, if you know how to manage LVM, its usage is also recommended as it will be easier to manage backups data later.
  
 
  mkfs.ext3 -L BACKUPPC -m 1 /dev/sdb1
 
  mkfs.ext3 -L BACKUPPC -m 1 /dev/sdb1
Line 79: Line 79:
 
*create some symlinks
 
*create some symlinks
  
This part is optionnal but recommanded. With these commands, all BackupPC related files (config and logs) will be stored on the BackupPC volume. You'll then be able to swap the BackupPC disk between two servers.
+
This part is optional but recommended. With these commands, all BackupPC related files (config and logs) will be stored on the BackupPC volume. You'll then be able to swap the BackupPC disk between two servers.
  
 
  mkdir -p /var/lib/BackupPC/{etc,log}
 
  mkdir -p /var/lib/BackupPC/{etc,log}
Line 95: Line 95:
  
 
*smeserver-template is a sample config file to backup a SME Server.
 
*smeserver-template is a sample config file to backup a SME Server.
*localhost-template is a sample to backup the server itself
+
*localhost-template is a sample config file to backup the server itself.
*windows-tempalte is a sample to backup a windows host using cygwin+rsyncd
+
*windows-template is a sample to backup a windows host using cygwin+rsyncd
  
 
To create a host using a template, create a new host, add =<template_name>
 
To create a host using a template, create a new host, add =<template_name>
Line 108: Line 108:
 
=== Upgrade from smeserver-backuppc.fws-3.0-1 ===
 
=== Upgrade from smeserver-backuppc.fws-3.0-1 ===
  
If you allready use the previous version of the contrib, some other steps are needed are the default location of the backups has changed from /opt/backuppc/files to /var/lib/BackupPC
+
If you already use the previous version of the contrib, some other steps are needed are the default location of the backups has changed from /opt/backuppc/files to /var/lib/BackupPC
  
 
The easiest way is just to symlink the old location to the new one:
 
The easiest way is just to symlink the old location to the new one:
Line 141: Line 141:
 
  signal-event backuppc-update
 
  signal-event backuppc-update
  
{{Note box|If you make changes to the "sudo" propertie, you should then check the sudoers syntax to be sure everything is OK. For this, you should run
+
{{Note box|If you make changes to the "sudo" properties, you should then check the sudoers syntax to be sure everything is OK. For this, you should run
 
  visudo
 
  visudo
 
And close the file. If visudo detects an error, it'll tell you. }}
 
And close the file. If visudo detects an error, it'll tell you. }}
 +
 +
=== Operation ===
 +
To configure a SME Server client to be backed up using a configuration based on the provided smeserver-template, configure SSH from the backup server as follows:
 +
 +
[root@backupserver ~]# su -s /bin/bash backuppc
 +
bash-3.2$ ssh-keygen -t rsa -b 2048
 +
(used a blank passphrase)
 +
bash-3.2$ cat /var/lib/BackupPC/.ssh/id_rsa.pub | ssh root@myserver.mydomain.com \
 +
"cat >> /root/.ssh/authorized_keys2"
 +
(confirm the host key)
  
 
=== Uninstall ===
 
=== Uninstall ===

Revision as of 13:01, 11 May 2009


Maintainer

Daniel B.
Firewall Services
mailto:daniel@firewall-services.com

Version

Contrib 10:
Contrib 9:
smeserver-BackupPC
The latest version of smeserver-BackupPC is available in the SME repository, click on the version number(s) for more information.


Contrib 9:
BackupPC
The latest version of BackupPC is available in the SME repository, click on the version number(s) for more information.


Description

BackupPC is a powerful, high-performance, enterprise-grade system for backing up a large number of Linux and Windows PCs and laptops to a server's disk. BackupPC is highly configurable and easy to install and maintain.

With the decreasing cost of disks and raid systems, it is practical and cost effective to backup a large number of machines onto a server's local disk or network storage. This is what BackupPC does. 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. A variety of Open Source systems are available for doing backup to tape.

BackupPC is written in Perl and extracts backup data via SMB using Samba, tar over ssh/rsh/nfs, or rsync. It is robust, reliable, well documented and freely available as Open Source on SourceForge.

More information & support is available at http://backuppc.sourceforge.net


Features

A clever pooling scheme minimizes disk storage and disk I/O. Identical files across multiple backups of the same or different PCs are stored only once resulting in substantial savings in disk storage and disk I/O.

One example of disk use: 95 laptops with each full backup averaging 3.6GB each, and each incremental averaging about 0.3GB. Storing three weekly full backups and six incremental backups per laptop is around 1200GB of raw data, but because of pooling and compression only 150GB is needed.

Optional compression support further reducing disk storage. Since only new files (not already pooled) need to be compressed, there is only a modest impact on CPU time.

No client-side software is needed. The standard smb protocol is used to extract backup data on Windows clients. On linux clients, tar over ssh/rsh/nfs is used to backup the data. With version 2.0.0, rsync is also supported on any client that has rsync or rysncd.

A powerful web (http/cgi) user interface allows administrators to view log files, configuration, current status and allows users to initiate and cancel backups and browse and restore files from backups.

A full set of restore options is supported, including direct restore (via smbclient, tar, or rsync/rsyncd) or downloading a zip or tar file.

Supports mobile environments where laptops are only intermittently connected to the network and have dynamic IP addresses (DHCP).

Flexible configuration parameters allow multiple backups to be performed in parallel, specification of which shares to backup, which directories to backup or not backup, various schedules for full and incremental backups, schedules for email reminders to users and so on. Configuration parameters can be set system-wide or also on a per-PC basis.

Users are sent periodic email reminders if their PC has not recently been backed up. Email content, timing and policies are configurable.

Tested on Linux, Freenix and Solaris hosts, and Linux, Windows 95, Windows 98, Windows 2000, Windows XP, and Windows Vista clients.

Detailed documentation.

Open Source hosted by SourceForge and freely available under GPL.

Requirements

  • SME Server 7.X
  • a dedicated volume is recommended (can be a simple disk or a RAID array)

Installation

  • Mount a volume on /var/lib/BackupPC

This part is optional but highly recommended. Backups should always be on a separate volume. First, prepare your hard drive for ext3 fs (you can use any fs which support hardlinks, I always use ext3 as it's very reliable) In this example, I use a simple partition /dev/sdb1, it could also be a RAID array (/dev/md3) or a LVM logical volume (or a combination of RAID and lvm). By the way, if you know how to manage LVM, its usage is also recommended as it will be easier to manage backups data later.

mkfs.ext3 -L BACKUPPC -m 1 /dev/sdb1

Now, we need to create the directory

mkdir -p /var/lib/BackupPC

Add the mount point in fstab. Just add something like:

/dev/sdb1    /var/lib/BackupPC       ext3    noatime 0 0

And check everything is ok

mount -a
mount | grep BackupPC
/dev/sdb1 on /var/lib/BackupPC type ext3 (rw,noatime)

  • create some symlinks

This part is optional but recommended. With these commands, all BackupPC related files (config and logs) will be stored on the BackupPC volume. You'll then be able to swap the BackupPC disk between two servers.

mkdir -p /var/lib/BackupPC/{etc,log}
ln -s /var/lib/BackupPC/etc /etc/BackupPC
ln -s /var/lib/BackupPC/log /var/log/BackupPC
  • install the rpms
yum --enablerepo=smecontribs install smeserver-BackupPC
signal-event backuppc-update

You should now be able to access the interface in the server-manager or directly on https://my.domain.tld/BackupPC

You'll find three sample configuration:

  • smeserver-template is a sample config file to backup a SME Server.
  • localhost-template is a sample config file to backup the server itself.
  • windows-template is a sample to backup a windows host using cygwin+rsyncd

To create a host using a template, create a new host, add =<template_name>

For example

myserver=smeserver-template

When you submit, the configuration from smeserver-template will be copied on my_server. You then can edit my_server's config

Upgrade from smeserver-backuppc.fws-3.0-1

If you already use the previous version of the contrib, some other steps are needed are the default location of the backups has changed from /opt/backuppc/files to /var/lib/BackupPC

The easiest way is just to symlink the old location to the new one:

ln -s /opt/backuppc/files /var/lib/BackupPC

Then, you can install the new release:

yum --enablerepo=smecontribs install smeserver-BackupPC

Then, just enter the following commands:

mv /etc/BackupPC/config.pl.back /etc/BackupPC/config.pl
mv /etc/BackupPC/hosts.back /etc/BackupPC/hosts
mv /etc/BackupPC/pc/localhost.pl.back /etc/BackupPC/pc/localhost.pl
db configuration delprop backuppc version
usermod -d /var/lib/BackupPC/ -m backuppc
mv /home/e-smith/files/users/backuppc/.ssh/ /var/lib/BackupPC/
signal-event backuppc-update

You should be done ;)

DB properties

there's only two properties you can change:

  • status: (enabled|disabled) Do you want the service to start automatically when the server boot ?
  • examples: (enabled|disabled) Do you want the sample configuration files to be added again if they are removed ?
  • sudo: a list of commands backuppc will be able to run as root using sudo. The default is "/usr/bin/rsync,/bin/gtar"

When you have configured this, you should run

signal-event backuppc-update


Important.png Note:
If you make changes to the "sudo" properties, you should then check the sudoers syntax to be sure everything is OK. For this, you should run
visudo

And close the file. If visudo detects an error, it'll tell you.


Operation

To configure a SME Server client to be backed up using a configuration based on the provided smeserver-template, configure SSH from the backup server as follows:

[root@backupserver ~]# su -s /bin/bash backuppc
bash-3.2$ ssh-keygen -t rsa -b 2048
(used a blank passphrase)
bash-3.2$ cat /var/lib/BackupPC/.ssh/id_rsa.pub | ssh root@myserver.mydomain.com \
"cat >> /root/.ssh/authorized_keys2"
(confirm the host key)

Uninstall

yum remove smeserver-BackupPC BackupPC

Source

The source for this contrib can be found in the smeserver CVS on sourceforge.

Bugs

Please raise bugs under the SME-Contribs section in bugzilla and select the smeserver-BackupPC component or use this link