Backup server module ( using RSYNC and cygwin )

Back up server module ( using RSYNC and cygwin )

 

 

On the linux server end

 

Apt-get install rsync

/etc/init.d/rsync start

 

Edit the  vi /etc/default/rsync

 Change RSYNC_ENABLE=false to true

 

sysv-rc-conf  –levels 1235 rsync on

 

Now we create a rsync.conf in /etc/

Vi /etc/rsyncd.conf

 

[agnellobackup]

path = /home/agnello/backup

comment = all agnello's backup

uid = agnello

gid = users

read only = false

auth user = agnello

secrets file = /etc/rsyncd.secrets

 

chown root:root /etc/rsyncd.conf

chmod 644 /etc/rsyncd.conf

 

 

Now we create the rsyncd.secrets in the /etc dir this is used for the windows client  for passwordless login  to the  linux server ( it  s in the format usename:password )  

vi /etc/rsyncd.secrets

 

agnello:agnello  

 

chown root:root /etc/rsyncd.secrets

chmod 600 /etc/rsyncd.secrets

 

 

Create user

Adduser agnello

 

Mkdir /home/agnello/backup

 

 

All data will be backed up in this directory

 

 

 

On the client side  ( windows xp ) ( make sure you are loged in as administrator )

 

Install cygwing on you windows machine

http://www.cygwin.com/              

 

at the time of installation it will give a option to install certain application install the following

Editors = Install nano for use as a simple text editor

 Net = install rsync for remote sync

 

Create a batch file with following

 

@cls
@echo off

rem Rsync job control file

C:\Cygwin\bin\rsync -vrtz --password-file=c:\cygwin\secret --delete "/cygdrive/c/Data"  agnello@192.168.0.244::agnellobackup

 

 

An explanation:

 

C:\Cygwin\bin\rsync    -    is the full path to ' rysync.exe'.

 

-vrtz    -    verbose (tell us what is being copied), recursive (descend into directories), transfer modification times, z (compress data).

 

--password-file=c:\cygwin\secret   -    Path to 'secret' file. (Note: Remember this is for backup to a Linux based Rsync Server; a Windows based Rsync Server cannot authenticate!)

 

--delete   -    delete remote files that are deleted locally.

 

/cygdrive/d/Data    -    in this example means D:\Data.

 

agnello@192.168..244::agnellobackup    -    is the user ID, hostname (can be IP address if over Local Network), and the module connection name (in this example 'modulename').

 

Now to create the password ( same as /etc/rsyncd.secrets ) on the windows client for passwordless login

 

Go to C:/cygwin/ run cygwin

 Go to cd /

Create a secret ( vi secret ) with content  agnello   give it 600 permission

 

 

Now create a  scheduled tals to rund every day  ( if you want to run it in minimized mode , create short cut of the batch file --- go to its properties ---- run minimized

 

 

END 



--

No comments:

Other Articles

Enter your email address: