Cloning a live system

Since i've gone over to a vps for my server, and i love backups (when i don't forget them...),
i had to figure out a way to clone my running system (since it's a vps, there's no livecd backup options, plus i dont want downtime)

The solution came in the form of rsync over ssh:

First order of business: i set up a new vm in my esxi at home, installing just a basic clean ubuntu, making sure it's harddrive was the same size (dont think thats needed, but still) and with a layout i wanted (closely mimicking the vps' layout)

after that, i made an exclude file, with things that are not to be cloned (since they are part of the system) :

/etc/network/interfaces (dont want to copy the ip config)

(save it to, for example, /root/exclude)

Then, running rsync: rsync -avze ssh --exclude-from=/root/exclude source:/ / (there's a space between the 2 slashes!)
You can to a test run by adding -n to make sure it'll do what you want.

Finally, i decided to modify some of the config files to get it to work locally to test the clone:
find /etc/apache2 -type f -exec sed -i 's/192\.168\.100\.1/192\.168\.100\.2/g' {} \; (do this for any directory you want files to be modified with the new ip)

Now i can sleep somewhat better knowing i have an up to date clone of my vps, making it just that little bit safer when something fails.