I am running 2 boxes on hetzner and would like to figure out the best way to back up the
- app
- data
- live environment

I understand that for the app and data parts, its very specific to my web service, so I am not going to go into too much detail here. But would really appreciate a general answer assuming the basics like LAMP on Ubuntu.

2 Answers
2

it all depends on how precious your data is and how much can you spend on backups. few random thoughts:

monitor your backups - make alerting system that notifies you if any of commands during your backup fails [ you can use trap ]

verify your backups from time to time - eg restore on a test site every quarter

if possible try to keep backups offline or at least use pull method not push [backup host logs into your production server to take backup, not the other way around] - in this way even if your server gets compromised and malicious attacker wipes it out she will be unable to delete your backups.

keep your backups secure... ideally - i'd have host not accessible from the internet [eg computer behind firewall or nat or both] initiate all backup procedure pulling all your data, file system level encryption like truecrypt for the backups host does not hurt either

keep few past backups - you can compress full dumps into separate archives and rotate them eg monthly or take advantage of tool like rdiff-backup. in case you screw something up and notice it only after few days it can be a life saver.

how busy your site is? if there are plenty of updates/inserts to the sql - consider having mysql replication slave with binary logging of all master queries turned on it. in this way you will be able to restore [at least the sql content] up to the moment before crash.

check if backups affect badly performance of your site, if needed use some throttling [ionice, rate limit for rsync or xtrabackup].