Activities

March 2008
M T W T F S S
    May »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Incremental backup – Re-synchronization over ssh

For doing this,
1, We need 2 Linux box with ssh service enabled
2, An ssh auto login to taking backup from
3,resysc command should be installed in backup server

A, SSH Auto login

############ SSH Auto login ###################

on the Client machine exicute the command from the data which to be taken from

a.) #ssh-keygen -d

it show something like this

Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
da:e9:42:61:f5:97:6e:40:e2:89:0a:12:35:f6:4a:b3 root@mysystem.local

b) Copy the content(/root/.ssh/id_dsa.pub) and pasted it on Backup server ~/.ssh/authorized_keys (Create a file if doesn’t exist)

c) On the source system edit the following the file and add the backup server entry in the ssh_config file

$vi /etc/ssh/ssh_config
Host <Backup server>

IdentityFile /root/.ssh/id_dsa (Which created on the beginning
Now you can able to ssh with source server without having any authentication
B, Execute this command on the Backup server
rsync –delete-after -zave ssh –progress <sourceIP>:<path/to/source/location> <path/to/backup>
This will synchronize the data on the source server with backup copy

Note:You can able to automated it as a cronjob by using the commands
Crontab entry will look like this ,it will execute every day at 12:30 AM

30 0 * * * sh /usr/local/share/backup/backup.sh /usr/local/share/backup/backup.log

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>