ASE Labs
Welcome Guest. Please register or log in now. There are 149 people online (0 Friends).
  • Home
  • Articles
  • News
  • Forum
  • Register/Login

BackupPC (Open Source)

Author
Aron Schatz
Posted
December 19, 2007
Views
66788
BackupPC (Open Source)
While talking about backups is one thing, doing it is another. BackupPC is a program that runs on a server to automatically backup your PCs. It is very useful and once setup, very powerful.
Tags Linux Open Source Software Backup BackupPC

Page 2: Transfer Setup, Restoration, Improvements, Conclusion

Transfer Settings:

There are a few ways to transfer data to the BackupPC server and which you use for each client depends on what the clients has installed. If the client is a Windows based PC, using smb (Samba) is most likely the easiest choice. For Unix-like operating systems, you can use rsync or rsyncd depending if you are running a rsync server on the client or not. Each configuration will be touched upon. We will now be using the command line to perform these tasks.

BackupPC has a global configuration file and then can have configurations for each host it backs up. The directory /etc/backuppc/ contains all the configuration files. If you want a specific host based configuration you need to have a file in that directory for the host. We will add an "asewebdns.pl" file into that directory for the new host to backup.

For each example the client PC's username to log in as will be "<username>" without the quotes. Password will be "<password>".

Rsync:

The rsync method is the best choice for Linux or Unix type PCs. As long as the client PC runs SSH, you can select this option. There is some setup involved such as exchanging SSH keys. This is a once time process. Using SSH keys is very secure as long as your server remains secure. If your server keys are compromised, so are the boxes.

The config file for this setup looks like this:

Code

$Conf{XferMethod} = 'rsync';
$Conf{RsyncClientPath} = '/usr/bin/rsync';
$Conf{RsyncClientCmd} = '$sshPath -q -x -l <username> $hostIP $rsyncPath $argList+';
$Conf{RsyncClientRestoreCmd} = '$sshPath -q -x -l <username> $hostIP $rsyncPath $argList+';
$Conf{RsyncShareName} = '/home/<username>/';


The first line says to use the rsync transfer type. The second line is a hint to tell where the rsync executable lies on the client PC. The third holds the command to backup the PC and the fourth for restoring. What you will need to edit is the <username> fields and possibly the last line which holds the path to backup. This path must be readable by the username. Since the boxes I'm backing up are primarily one user, I only back that account up. You should use root for backing up the entire PC and make the share name "/" for everything. The backup command basically says to use SSH with some switches to log in as <username> at the host's IP address with the command passed for rsync. Fairly straight forward.

Now we need to setup the client PC to handle this request without asking to log-on. You need to first be logged in as the backuppc user. At a prompt, type:

sudo su backuppc

This will bring you to (probably) a sh shell. Type 'bash' to get to a bash prompt. You'll want to use the directory for backuppc's home. Type "cd ~" at the prompt. Now you want to generate a rsa key from ssh. Type:

ssh-keygen -t rsa

Which will look like this:

Code

backuppc@asetest:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/var/lib/backuppc/.ssh/id_rsa):
Created directory '/var/lib/backuppc/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /var/lib/backuppc/.ssh/id_rsa.
Your public key has been saved in /var/lib/backuppc/.ssh/id_rsa.pub.
The key fingerprint is:
4b:xx:b4:xx:55:f3:xx:2c:xx:32:49:a5:xx:ea:9b:11 backuppc@asetest


Accept the defaults and press enter for everything. Now we want to copy the id_rsa file you just made onto the client PC. We also need to exchange public keys which we can do in one step. Type:

scp /var/lib/backuppc/.ssh/id_rsa.pub <username>@<clientpc>:/home/<username>/sshkey.server.rsa (Ex: scp /var/lib/backuppc/.ssh/id_rsa aron@asewebdns:/home/aron/sshkey.server.rsa)

The scp program runs off of ssh and it will ask you to verify the authenticity of the client. Accept and enter your password for the client machine. When the file has been copied, you need to ssh into the client machine. Type:

ssh <username>@<clientpc> (Ex: ssh aron@asewebdns)

Now the client PC will just ask for your password. You should now be at a bash prompt. Type:

cat ~/sshkey.server.rsa >> ~/.ssh/authorized_keys2

That command took the server's key and added it to the client PC's authorized key list to enable passwordless logins for that specific username. You should now delete the key. Type:

rm ~/sshkey.server.rsa

Type "exit" to get off the client PC. Type "exit" again to log out of the backuppc user on the server. Type "exit" again to completely log off. You are done with the command line portion. Now all you need to do is check that the backup will be successful. Go to the web interface and start a backup. It should now work normally. Congratulations. You setup BackupPC for rsync!

Rsyncd:

This type of transfer assumes that there is a rsync daemon running on the client PC. This type of setup might be a rsync server that you want to backup. This case is trivially easy. The file for the config will look like:

Code

$Conf{XferMethod} = 'rsyncd';
$Conf{RsyncShareName} = 'backup';
$Conf{RsyncdUserName} = '<username>';
$Conf{RsyncdPasswd} = '<password>';
$Conf{RsyncdAuthRequired} = 1;


Really, no extra setup is required since the client computer already has an rsync server running. You'll want to modify the share name and the user and password lines. Notice how the share name config option is the same as the previous type of transfer.

Smb:

This transfer type uses Samba which is perfect for Windows clients. You can use the default administrative share to grab the files off of a Windows PC as long as you have an administrator log-in and password. I'll use backup/backup for that purpose now. The file looks like:

Code

$Conf{SmbShareName} = 'C$';
$Conf{SmbShareUserName} = 'backup';
$Conf{SmbSharePasswd} = 'backup';
$Conf{XferMethod} = 'smb';


You may not know what that "C$" sharename means. A share with a dollar sign after it means hidden in the Windows world. This special share is always enabled and basically shares out all the partitions by name. There is will special shares for each partition. If you have a "D" partition, expect a "D$" share. Make sure that file and printer sharing is enabled in the Windows firewall.

That was really all the setup that's needed for the Windows boxes.

Restoration:

Stored Backups


Restoring files directly on the client PC is as simple as starting a backup is. On the host selection screen, switch to the client PC you want to restore files for. You have the option of directly restoring files or downloading the backups. I suggest always to download the backups. A direct restore will overwrite whatever is contained on the client PC.

Select Restore


Select the files you want to restore and hit the restore selected files button. This takes you to a screen that will show you the files and how to restore them. From this screen you can select the option you want. You'll probably want to make a zip of them to download. That was easy.

Restore


Improvements:

I would like to see BackupPC be able to be controlled fully by the browser. You should be able to setup new host configurations and such all on the web. Another problem is that the current version of BackupPC I was running (3.0.0) doesn't show a transfer status. You just need to wait till a transfer is done. This is a problem. I would like to know how long the backup will take.

Conclusion:

BackupPC is a very handy free and open source tool to use in your home or business. It is robust enough to handle a variety of tasks and simple enough to be setup.You can try BackupPC if you have a Linux distribution by heading over to the Sourceforge page. It beats paying for software that does the same stuff and works on pretty much every platform. Once again, please »post on the forums with any questions or comments you have.
« Previous Page  
Page 1
Page 2
View As Single Page Print This Page Print Entire Article
Related Articles
  • KDE4: How It Looks
  • Open Source Alternatives
  • Feisty And Like A Fawn: Ubuntu 7.04
  • Switch To Open Source Today
  • Free Or Free?
members/attachments/upload/2007/12/19/2166m.png 1.png members/attachments/upload/2007/12/19/2167m.png 2.png members/attachments/upload/2007/12/19/2168.png Login members/attachments/upload/2007/12/19/2169m.png Status members/attachments/upload/2007/12/19/2170m.png Host Summary members/attachments/upload/2007/12/19/2171m.png Host Config members/attachments/upload/2007/12/19/2172m.png Main Config members/attachments/upload/2007/12/19/2173m.png Add Host members/attachments/upload/2007/12/19/2174m.png Stored Backups members/attachments/upload/2007/12/19/2175m.png Select Restore members/attachments/upload/2007/12/19/2176m.png Restore members/attachments/upload/2007/12/20/2177.jpg title.jpg

Title

Medium Image View Large
Login
Welcome Guest. Please register or log in now.
Forgot your password?
Navigation
  • Home
  • Articles
  • News
  • Register/Login
  • Shopping
  • ASE Forums
  • Anime Threads
  • HardwareLogic
  • ASE Adnet
Latest News
  • Kingston HyperX Cloud 2 Pro Gaming Headset Unboxing
  • Synology DS415+ Unboxing
  • D-Link DCS-5020L Wireless IP Pan/Tilt IP Camera
  • Actiontec WiFi Powerline Network Extender Kit Unboxing
  • Durovis Dive Unboxing
  • Bass Egg Verb Unboxing
  • Welcome to the new server
  • Gmail Gets Optional Preview Pane
  • HBO Go on Consoles
  • HP Touchpad Update
Latest Articles
  • D-Link Exo AC2600 Smart Mesh Wi-Fi Router DIR-2660-US
  • HyperX Double Shot PBT Keys
  • Avantree ANC032 Wireless Active Noise Cancelling Headphones
  • ScharkSpark Beginner Drones
  • HyperX Alloy FPS RGB Mechanical Gaming Keyboard
  • D-Link DCS-8300LH Full HD 2-Way Audio Camera
  • Contour Unimouse Wireless Ergonomic Mouse
  • HyperX Cloud Alpha Pro Gaming Headset
  • Linksys Wemo Smart Home Suite
  • Fully Jarvis Adjustable Standing Desk
Latest Topics
  • Hello
  • Welcome to the new server at ASE Labs
  • Evercool Royal NP-901 Notebook Cooler at ASE Labs
  • HyperX Double Shot PBT Keys at ASE Labs
  • Avantree ANC032 Wireless Active Noise Cancelling Headphones at ASE Labs
  • ScharkSpark Beginner Drones at ASE Labs
  • HyperX Alloy FPS RGB Mechanical Gaming Keyboard at ASE Labs
  • D-Link DCS-8300LH Full HD 2-Way Audio Camera at ASE Labs
  • Kingston SDX10V/128GB SDXC Memory at ASE Labs
  • What are you listening to now?
  • Antec Six Hundred v2 Gaming Case at HardwareLogic
  • Sans Digital TR5UTP 5-Bay RAID Tower at HardwareLogic
  • Crucial Ballistix Smart Tracer 6GB PC3-12800 BL3KIT25664ST1608OB at HardwareLogic
  • Cooler Master Storm Enforcer Mid-Tower Gaming Case at HardwareLogic
  • Arctic M571-L Gaming Laser Mouse at ASE Labs
  • Contour Unimouse Wireless Ergonomic Mouse at ASE Labs
Press Release
  • Huntkey Has Launched Its New Power Strips with USB Chargers on Amazon US
  • Inspur Releases TensorFlow-Supported FPGA Compute Acceleration Engine TF2
  • Hot Pepper Introduces Spicy New Smartphones in US Markets
  • Sharp Introduces New Desktop Printers For The Advanced Office
  • DJI Introduces Mavic 2 Pro And Mavic 2 Zoom: A New Era For Camera Drones
  • DJI Introduces Mavic 2 Pro And Mavic 2 Zoom: A New Era For Camera Drones
  • Fujifilm launches "instax SQUARE SQ6 Taylor Swift Edition", designed by instax global partner Taylor Swift
  • Huawei nova 3 With Best-in-class AI Capabilities Goes on Sale Today
  • Rand McNally Introduces Its Most Advanced Dashboard Camera
  • =?UTF-8?Q?My_Size_to_Showcase_Its_MySizeId=E2=84=A2_Mobil?= =?UTF-8?Q?e_Measurement_Technology_at_CurvyCon_NYC?=
Home - ASE Publishing - About Us
© 2010 Aron Schatz (ASE Publishing) [Queries: 18 (7 Cached)] [Rows: 310 Fetched: 133] [Page Generation time: 0.28364419937134]