Is it possible to clone an Ubuntu system and if any changes are made to original system, those should be replicated to the one cloned? I need to have backup support if original one gets down. In my case, Ubuntu is a cloud server.
Please guide me step by step.
I would use rsync with SSH keys over the network and set it to run frequently with cron. This way, only the changes need to be transmitted.
Format taken from how do I do mass installs?
On the machine that will serve as a backup, make a file named
/etc/cron.daily/backup-pull
then make it executablesudo chmod +x /etc/cron.daily/backup-pull
. Replace${host}
with the IP of the original system.You'll have daily syncs of the original server to this one. You could also do cron.hourly instead of cron.daily if you're really paranoid.
Please refer to https://help.ubuntu.com/community/BackupYourSystem/SimpleBackupSuite and https://help.ubuntu.com/community/BackupYourSystem , also Comparison of backup tools .
If you want to only save the changes in packages installed, etc, you can use
dpkg --get-selections > installed_packages
, and restore those withapt-get update && dpkg --set-selections < installed_packages && apt-get upgrade
.To backup your user files, it is sufficient to copy the
/home
directory to the remote server, refer to the second link.You probably want to use something like drbd. Probably combined with something like Heartbeat. More info about that on the Linux High Availability site.
I suppose some cloud or cluster solutions come with similar functionality built-in or available as extensions, you might want to dig into their documentation.
The data itself will need to be backed up by other means but for repeatable configurations I would really look at tools like preseed and puppet. With puppet and preseed you also get the benefit of some level of self documentation on the configurations as well.
You should use virtualisation. Software like KVM or Xen allow You to create a virtual machines, which are like normal machines, but You can clone them and copy to another physical machine.
I cannot guide You step by stem because every situation is different. I recommend read a documentation on these sites and ask when You encounter a specific problem.
Check out remastersys. Remastersys is a tool that can be used to do 2 things with an existing Debian, Ubuntu or derivative installation.
http://www.geekconnection.org/remastersys/index.html