Advertisement
     
 
 
Search:
General | Linux Hacking | Linux Networking | Linux Security | Windows Hacking
       
Automate Backups on Network Using RSync PDF Print E-mail
Written by hakimkt   
Wednesday, 26 January 2005
Use Rsync, a Linux program, to back up and sync data with Windows clients.it uses the "rsync algorithm" which provides a very fast method for bringing remote files into sync. It does this by sending just the differences in the files across the link, without requiring that both sets of files are present at one of the ends of the link beforehand. At first glance this may seem impossible because the calculation of diffs between two files normally requires local access to both files. sync is a small program that you can use to back up data from computers on to a central network server. The good thing about Rsync is that it syncs data for back up without affecting the network bandwidth. It performs incremental backup, which means, if a backedup file already exists on the central server, it copies only the difference between the two files, thereby not affecting network traffic (on LANs or WANs). Rsync can sync data even over a modem connection. It also creates a mirror of your hard drive on the central server so that you can recover your data if your hard drive crashes.



RSync is a Linux program that has been ported to Windows and is also available for various UNIX platforms. This article will guide you on setting up a central network backup unit for use with Windows clients.

Set up server
When we set up Rsync, we used a Linux box running PCQLinux 8.0. You need to first create accounts for all the Windows and Linux users on your network, who would be backing up their data on this server. Next, you need to ensure that it has Samba running to provide file services to all the Windows clients. It must also have a NetBIOS name, say Remote1. Finally, remember to make sure that Samba is sharing the home directories of all the users you created on this server.

Set up Windows clients
You’ll need to apply the following process to all the Windows clients that would be using Rsync on your network. It works on all the popular Windows versions (9x/ 2000/XP).

First, install Cygwin (on PCQ Essential CD, July 2003) on each Windows client by running the setup.exe file. Next, copy the rsync.zip file from this month’s CD to this machine’s local drive (say c:). Unzipping this file will create a folder C:rsync. Make sure each Windows machine can access the Remote1 server.

Now, open a command window from the Windows machine and go the C:rsync folder. Here, edit the rsetup.bat file. Find the entry USERNAME=myusername and replace myusername with the user you created for this Windows client on Remote1. Save the file and enter rsetup at the command prompt to install Rsync . This will also set the required path variables for Rsync.

Run RSync
To run Rsync from the Windows machine, open the command window and go to the C:rsync folder. Then, run the following command to take a backup or sync data:

C:rsync>rsync251-2.exe -e ssh -av --delete -/cygdrive/c/ remote1:data
After running this command, you will be prompted for a password. Give the password corresponding to the user name on remote1. The above command will back up the entire C drive to the machine named remote1 in the folder named data under the user’s home directory.

Recover data
You can recover data from the server by simply browsing it from the Windows Network Neighborhood and copying the files back to your system. Or, you can use a command line to retrieve the data as follows:

C:rsync>rsync251-2.exe -e ssh -a remote1:/data/ .

where, the final (.) is your local destination.
Automate back up
You can automate backup and sync processes by writing a sequence of commands in a batch file and setting the Windows
Scheduler to execute this.

This program thus helps to sync data over the network without affecting the network bandwidth.

HakimKT Kuwait
hakimkt@yahoo.com


Add as favourites (126)

  Be first to comment this article

Write Comment
  • Please keep the topic of messages relevant to the subject of the article.
  • Personal verbal attacks will be deleted.
  • Please don't use comments to plug your web site. Such material will be removed.
  • Just ensure to *Refresh* your browser for a new security code to be displayed prior to clicking on the 'Send' button.
  • Keep in mind that the above process only applies if you simply entered the wrong security code.
Name:
Comment:

Code:* Code

 
< Prev   Next >
 
© Copyright 2002-2008 - Linux Exposed - Sponsored by ConsultPlanet http://www.consultplanet.nl - Contact Linux Exposed