Mirroring is a hard to digest word for a normal computer user and usually prefers to risk the security of his data rather than have  a redundant backup.

Lets define a mirror
In data storage, disk mirroring is the replication of logical disk volumes onto separate physical hard disks in real time to ensure continuous availability.
However ,I just explain how a redundant backup is to be created and not on the fly transfer of control to the mirror in case of failure.

So,Here are the things you would need:
1)A master server(preferably ubuntu)
2)A slave server,configured in the same way as the master
3)SSH server installed at the slave server
4)SSH client at the master (should be available by default)

Before we start,lets define a few things:

a)Both the master and slave has the sever username as "server"
b)The directory to be backed up is hitherto referred as DIR.For eg, /home/server/www
c)IP of the master is 192.168.0.1
d)IP of the slave is 192.168.0.2

Step 1:

Generate an rsa key at the master and slave
ssh-keygen -t rsa -C '<email>'
Use Default directory
Opt for empty passphrase.

Step 2:

On the slave,open ~/.ssh/id_rsa.pub and copy the contents to the master's ~/.ssh/authorized_keys.Create  the file,it will be absent by default.

On master run the command
ssh server@192.168.0.2
Reply yes to the question asked and exit using Ctrl+d.

Step 3:

On the master, edit the crontab by using the command crontab -e A crontab is used to a task,ie run a command repeatedly at fixed intervals of time.

Add the following command to the crontab.
* * * * * rsync -avz DIR server@192.168.0.2:DIR
The meaning of the command is that run the rsync command every minute everyday. rsync -avz copies a source to a destination including file permissions and ownership,every minute.The first DIR is the directory in the master server while the server@192.168.0.2:DIR refers to the directory in the slave server.

If in any case the master server stops,either assign the IP of the master to the slave manually,if possible(it might be impossible if there is a MAC ID authentication) or edit the DNS to redirect the requests to the slave.Or just start using the slave as master by using the slave IP.