Installation of BackupPC on an Ubuntu Server with NAS as a destination drive

Introduction
BackupPC is a high-performance, enterprise-grade system for backing up Linux, WinXX and MacOSX PCs and laptops to a server's disk. BackupPC is highly configurable and easy to install and maintain.
In this guide, we will install BackupPC on an Ubuntu 12.04 server and use a NAS to store the backed up data.
In Ubuntu 12.04 Server, the default install of BackupPC stores all the backups in the directory /var/lib/backuppc which is located on the main hard disk drive /dev/sda.  However, we wanted to store all the backups on a NAS or to an another HDD. 
Installing BackupPC
BackupPC is available in Ubuntu's default repositories. So you can open a terminal and enter the following commands:
sudo apt-get update
sudo apt-get install backuppc
During the installation, you may be asked for the following:
1.      mail server configuration
2.      Using Apache2 with BackupPC
3.      Changing the Password
BackupPC creates a system user called "backuppc" to perform its tasks.
In addition, it configures an Apache user called "backuppc", which was given briefly during installation. We can change this password by typing the following commands:
sudo htpasswd /etc/backuppc/htpasswd backuppc
You will be asked to give and confirm a new password.
Moving the BackupPC Destination directory to NAS:
Step 1: Mount the NAS partition to the BackupPC server. You can follow this post to do this. For example, we can consider the NAS partition is mounted as /data
Step 2: Copy the BackupPC data directory contents to the NAS by using this command
   sudo cp -r /var/lib/backuppc /data

Step 3: set the NAS directory owner to 'backuppc' by using this command
   sudo chown -R backuppc:backuppc /data/backuppc

Step 4: Now check the new data directory is present and has the right permissions with its contents
   sudo ls -al /data
 
   sudo ls -al /data/backuppc
 
Step 5: Remove the old BackupPC data directory:
   sudo rm -r /var/lib/backuppc

Step 6: Set up a Symbolic Link from the Old Location to the
New location
 
   sudo ln -s /data/backuppc /var/lib/backuppc

Step 7: Set the owner of the symbolic link to 'backuppc':
   sudo chown -h backuppc:backuppc /var/lib/backuppc

Step 8: Check the symbolic link is present and has the right permissions with right contents:
   sudo ls -al /var/lib
 
   sudo ls -al /var/lib/backuppc

Step 9: Restart the server
   sudo reboot
Step 10: Point your web browser at http://IPADSRESS/backuppc. The BackupPC Server should display the Status page. You are done.
Conclusion
BackupPC is a powerful tool to automatically backup files from several servers to a central location. I am using BackupPC in my production environment. The raw content is of 360 GB but after deduplication and compression, it is of 45 GB only.
The compression and the deduplication features make BackupPC one step ahead of other open-source Backup tools.  



No comments:

Post a Comment