Search Perform an advanced search query SOFTPEDIA
 
SOFTPEDIA
Updated one minute ago
HomeSubmit a program for being reviewedAdvertise on our websiteGet help on surfing our websitesSend us your feedbackGet information about our XML/RSS backend and how to use itBrowse the news archiveVisit our discussion forumVizitati forumul in limba romana



KLIP
  1. HOME
  2. SCIENCE
  3. TECHNOLOGY
  4. WEBMASTER
  5. SECURITY
  6. MICROSOFT
  7. LINUX
  8. APPLE
  9. GAMES
  10. TELECOMS
  11. REVIEWS
  12. LIFE & STYLE
  13. EDITORIALS
  14. INTERVIEWS
  15. RSS
Welcome!
Hello, Guest

Login if you have a Softpedia.com account.

Otherwise, register for one.

OTHER TIPS, TRICKS AND TUTORIALS

Automated Remote Back-ups with rdiff-backup

- How to setup an unattended back-up process.

By: Mihai Marinof, Linux Editor

rdiff-backup is an utility capable of maintaining a back-up mirror of a file or directory over the network, on another server. It stores incremental rdiff deltas with the back-up, which allows you to recreate any back-up point. The back-up is encrypted through the SSH protocol, thus no one will be able to read the data being transferred. Moreover, rdiff-backup is saving bandwidth by making incremental back-ups.

Prerequisites

As for all back-ups, you should be planning what you want to do, before actually doing it. Next, you should make sure that both computers are reachable from the Internet (or at least the computer you want to back-up) and whether both computers have SSH (client and daemon) installed and configured properly. As an example for this guide, I'll back-up a directory on my work computer, to a directory on my home computer.

Installation

- First of all, you'll need to install rdiff-backup on both computers. This is a very popular utility so it's most likely to find it in your distribution's repository so use your package manager to install it. Eg:

Fedora:
CODE

# yum install rdiff-backup


Debian/Ubuntu:
CODE

$ sudo apt-get install rdiff-backup


- Now for the tricky part. Because rdiff-backup is using SSH, which asks for a password upon logging in, it will require human interaction during the actual back-up process. And because we are trying to setup an automated process, this is not what we want. Fortunately, this problem can be easily skipped by using SSH public keys. So, we'll need to create a pair of keys on the home computer, one of which will be saved on the work computer. Basically, these keys will tell the work machine that the home machine is allowed to login through SSH.

Generate a DSA key pair on the home computer:
CODE

$ ssh-keygen -t dsa


Hit enter when you are asked for the target directory and for the passphrase.

Send the public key to the work computer:
(The work computer has to have used the ssh client, otherwise, the .ssh directory won't exist)
CODE

$ cd $HOME
$ scp .ssh/id_dsa.pub work-user@work.computer.IP:~/.ssh


Log in to work PC and add the key to the list of authorized keys:
CODE

$ ssh work-user@work.computer.IP
$ cd .ssh
$ cat id_dsa.pub >> authorized_keys2
$ rm -rf id_dsa.pub


- Test if everything is ok: Log out and log back in, this time, you shouldn't be asked for a password.

Actual back-up process

- What we want to do here is back-up the scripts/ directory on the work PC to the home PC. To do this, type the following command on the home machine:

CODE

$ rdiff-backup -v4 --print-statistics work-user@work.computer.IP:://home/work-user/scripts/ scripts/


Automating the process with crontab

- On the home machine, type the following command to open the crontab editor:

CODE

$ crontab -e


It will open vi. If you don't know how to use it, I’ll try to explain shortly. Once it started, press INSERT key to start writing into it. Now, add the following line:
CODE

30 4 * * * /usr/bin/rdiff-backup work-user@work.computer.IP:://home/work-user/scripts/ scripts/

Now press ESCAPE key, then SHIFT + ; and finally, wq

As of now, every night at 4:30, the scripts directory from the work PC will be saved to /home/home-user/scripts directory and will be updated if any scripts are added to the work directory.

MORE RELATED ARTICLES: Mounting Remote Directories through SSH Installing Lighttpd on Fedora and Ubuntu GNU Screen Tutorial Setting Up A Central Syslog Server Creating a Local Update Repository for FC6 Wolfenstein: Enemy Territory Server Setup How to Bind a Range of IPs Screencast Guide: Capure Your Linux Desktop on Video! How to Setup an Encrypted Filesystem Grant Root Privileges to Regular Users
 
Comments | Link here | Subscribe
Print | Send to friend
Today's News | Yesterday's News

Search:

23rd January 2007, 11:24 GMT | Copyright (c) 2007 Softpedia | Contact:
Read by 2,834 user(s) | Rating: | 9 vote(s) so far | Cast your vote:
Automated Remote Back-ups with rdiff-backup - USER OPINIONS




We are sorry, there are no opinions available for this article.






SHARE YOUR OPINION ABOUT Automated Remote Back-ups with rdiff-backup

Since you are not logged on, your comments will have to be approved before being displayed.
Click here to login, or register.
Your Name:
Your Email:
Type in the result:
Your Opinion:
 


DO YOU WANT TO CONTACT US?  

If you have some comments or you want to send us some information you can send us an email directly to .
You can use the form below for the same purpose.
Your full name: (at least 3 characters)
Your email address: (at least 5 characters)
Message subject: (at least 5 characters)
Message text:
(at least 10 characters)
Type in the result:
 
 



© 2001 - 2008 Softpedia. All rights reserved.
Softpedia™ and Softpedia™ logo are registered trademarks of SoftNews NET SRL.
Copyright Information | Privacy Policy | Terms of Use | Contact Softpedia | Update your software | Archive