Data Networking/Fall 2014/Shalini/Backup

BACKUP edit

Backup is the process of saving the data in a different location, so that it can be used in the case of data loss. Basically, if our web server lose the data or there is a situation of extra load on the web server, we can use this back up data. This means the back up data will help in retaining the data and in load balancing. In our project we have made a back up of our web server in the DNS server and have scheduled the back up every 1 hour. This means that the data of web server will be copied to back up location after every one hour .therfore, if a situation arises, we will have our data saved at the replicated location.

Implementation edit

As , we are making the back up in the DNS server, it is necessary for us to run apache on both the machines. This will make it run like an web server over other linux machine. Once we have apache server installed on our machines, we can follow the procedure used for back up.

1. Installing the Apache in back up server

 sudo apt-get install apache2

This will install the apache server on our machine.

2. Install the Rsync (In webserver and back up server) Rsync is used to manage the back up on the server machine.

 sudo apt-get install rsync

3. To get the back up within other directort of web server

 sudo 	rsync –avz –progress / var/www/ /path of backup directory/

4.Install the SSH Rsync ( In webserver and back up server)

 sudo apt-get install ssh rsync

5.To put the backup in another server (To be executed in the back up server)

 sudo rsync -avz –progress -e ssh pranay@192.168.3.60 /var/www/ /path of back up directory/

Before this command we need to change the permissions of the specified directories using the following command:

 sudo chmod 777 /var/www/ *in the web server
 sudo chmod 777 /path of back up directory/ *in the back up server

6. To schedule the back up every 5 minutes, Crontab is used

 sudo crontab -e 60 00 *** rsync -avz –progress -e ssh pranay@192.168.3.60 /var/www/ /path of back up directory/

Testing edit

The commands are executed in the back up server and the copy of the web server file was sucessfully transferred to the specified path of the back up server. Certain changes were made to the web server file and the scheduling command was executed in the back up server. After a period of 5 minutes, the new file of the web server was transferred to the specified back up location.