User Rating: / 1
PoorBest 

Bookmark and Share

If you are new to Unixmen, you may want to subscribe :

BackupPC is an entirely disk-based backup and recovery system. It offers a number of advantages, some of which are available only with BackupPC,

Backuppc Support any client OS and has a Web interface to allows user control of and access to backups

How BackupPC Works

The BackupPC model has one user per client. This fits the usage pattern of the type of environment it was specifically designed for: backing up several users’ PCs (hence the name). This should typically be the user who owns the data on the machine. In the case of a large file server, it should be an administrator. BackupPC emails the owner if it cannot back up the client after a configurable time, and the owner can control restores using the web interface. The following list describes how BackupPC works.

Now we will show you how install Backup pc on Centos/Rhel/Fedora, the current installation is done on a machine with CentOS 5.2 installed, but it work also for fedora and RHEL.

Open your terminal, and under root type :

 yum install perl-Compress-Zlib perl-Archive-Zip perl-File-RsyncP perl-XML-RSS httpd
 rpm  -Uvh   http://dev.centos.org/centos/5/testing/i386/RPMS/backuppc-3.1.0-1.el5.centos.i386.rpm

1- Add user backuppc to your machine, User backuppc will be created upon installation. Change apache user to backuppc.

 vi /etc/httpd/conf/httpd.conf

 

Change 'User apache' to 'User backuppc

Save

2- Edit file /etc/httpd/conf.d/backuppc.conf

 # vi /etc/httpd/conf.d/backuppc.conf   

 

change 'Allow from 127.0.0.1' to 'Allow from all'

Save

3- Create password for cgi-bin admin user

# htpasswd -c /var/lib/backuppc/passwd/htpasswd admin

4- Edit backuppc config file

# vi /etc/BackupPC/config.pl 
Find and change accordingly
$Conf{ServerHost} = 'localhost';
$Conf{SplitPath} = '/usr/bin/split';
$Conf{CatPath} = '/bin/cat';
$Conf{GzipPath} = '/bin/gzip';
$Conf{Bzip2Path} = '/usr/bin/bzip2';
$Conf{BackupPCUser} = 'backuppc';
$Conf{TopDir} = '/var/lib/backuppc';
$Conf{ConfDir} = '/etc/BackupPC';
$Conf{LogDir} = '/var/log/BackupPC';
$Conf{InstallDir} = '/usr';
$Conf{CgiDir} = '/usr/share/backuppc/cgi-bin';
$Conf{ServerInitdPath} = '/etc/init.d/backuppc';
$Conf{ServerInitdStartCmd} = '$sshPath -q -x -l root $serverHost$serverInitdPath start';
$Conf{SshPath} = '/usr/bin/ssh';
$Conf{NmbLookupPath} = '/usr/bin/nmblookup';
$Conf{PingPath} = '/bin/ping';
$Conf{CgiAdminUsers} = 'admin';

Save

5- Grant passwordless sudo for user backuppc to run /bin/gtar and /bin/tar

# visudo

 

Add these entries :

Defaults !lecture # to disable lecture

backuppc ALL=NOPASSWD:/bin/gtar,/bin/tar # enable user backuppc to run /bin/tar and /bin/gtar without authentication.

Comment this entry

#Defaults requiretty

Save and exit

Restart apache and backuppc service

# /etc/init.d/http restart
# /etc/init.d/backuppc restart

 

Open your browser and point it to 'http://backuppc_server_ip/backuppc' and you should see the backuppc web interface

 

After this, you have to do almost all the configuration through the web interface. To test, you can run localhost backup first. You have to create the host, fill up all the setting and you are ready to go. Record the host and ip in /etc/hosts.

II Client setup

1 - Create new user

# useradd backupuser
# passwd backupuser

2- Grant passwordless sudo for user backupuser

# visudo
Add these entries

Defaults !lecture # to disable lecture

backupuser ALL=NOPASSWD:/bin/gtar,/bin/tar # enable user backuppc to run /bin/tar and /bin/gtar without authentication.

Comment this entry

#Defaults requiretty

Save

3- From the server using backuppc user, create ssh public key

# su -s /bin/bash backuppc
$ mkdir .ssh
$ chown backuppc.backuppc .ssh
$ chmod 700 .ssh
$ ssh-keygen -t rsa
$ ssh-copy-id -i .ssh/id_rsa.pub backupuser@client

4 - To make sure that the 3rd step is a success, try to ssh to backupuser@client using backuppc user from the server. If no password is asked, then you are ready.

# su -s /bin/bash backuppc
$ ssh backupuser@client

You can start entering the client to the list of host and start backing up :)


If something didnt work , please post it in the forum

If you need support to install Backup pc on Ubuntu, just post your request in the comment bellow.


If you are here for the first time, you may want to subscribe to our rss feed or to follow us on Twitter. Thanks for visiting.


Related Articles By Tags :


Related Articles By Tags:

Comments (6)
  • Ivan  - problem with XML::RSS
    avatar

    Hello,

    I am trying to install backupPC following your how-to but i always get this message:

    perl(XML::RSS) is needed by backuppc-3.0.0-1.el4.centos.i386

    I did install it via CPAN:
    cpan> install XML::RSS
    CPAN: Storable loaded ok
    Going to read /root/.cpan/Metadata
    Database was generated on Mon, 26 Oct 2009 09:28:19 GMT
    XML::RSS is up to date.

    But still getting the same message...

    Any suggestion??

    --Ivan.

  • lamauser
    avatar

    please check here :
    http://packages.sw.be/perl-XML-RSS/

  • Ivan  - Made it work
    avatar

    Hello,

    I did install the XML::RSS via rpm and it worked fine (i did it before using the cpan console) and this time it did work! =]]
    Now im trying to get into the web console but the user admin seems to not be working... I tried with
    htpasswd -c /var/lib/backuppc/passwd/htpasswd admin
    but is not working.
    Any thoughts??

  • pirat9
    avatar

    Ivan.
    try with other user
    htpasswd -c /var/lib/backuppc/passwd/htpasswd yourname

    and let me now if it works

  • Ivan  - Finally i got in.. but something else now =[
    avatar

    Hello,

    Thx for the replies.. I did get into the web interface, at the beginning was getting this message in the apache log:

    (13)Permission denied: Could not open password file: /var/lib/backuppc/passwd/htpasswd

    I have changed the topDir location and maybe it was permission related, I change back the topDir location and now is working.
    But now when i got into the web interface, if I click on the status, host summary, logs or email summary i get the following error:

    Error: Unable to connect to BackupPC server

    I am able to access the config, hosts or admin options though.

    I will appreciate your comments.

    --Ivan.

  • Ivan  - Fixed
    avatar

    Hey,
    Just to let you know it was SELinux related, I did setenforce = 0 and now it is working fine.

    --Ivan.

Write comment
Your Contact Details:
Gravatar enabled
Comment:
[b] [i] [u] [s] [url] [quote] [code] [img]   
:D:):(:0:shock::confused:8):lol::x:P:oops::cry:
:evil::twisted::roll::wink::!::?::idea::arrow: