1

I have a linux server. several days ago one of HDDs attached to the server crashed and i was very lucky not to loose anything important cause that was my backup HDD.

Now i'm looking for a solution to do incremental backup up of all important stuff on my server to my local machine so in case the datacenter of my provider is blown up by terrorists/UFOs/crazy monkeys i will have all the data i need to restore everything.

What i need to backup is: all my apache's web folders, mysql databases, tomcat installation, lots of configurations, git repositories and some other plain old files which are rarely modified.

what tools/software do you recommend me to use? cause i don't know anything suitable for this specific case.

BTW: my windows machine doesn't have a static ip address so it's desirable for it to automatically request & download the new update every day and not the server to connect and upload everything to it.

2 Answers2

2

I like Bacula a lot myself. Some scripting will be needed with that to dump your MySQL server, or you could use a set of scripts to just tarball everything. Bacula gives you incremental backups, though. Either way, I suggest backing up to a schedule, and having the windows machine connect & move whenever it gets a chance.

Jeff Ferland
  • 20,547
  • 2
  • 62
  • 85
0

You can do what you want with rsync -- almost every Linux system has this installed by default, or it can be installed using your distribution's package manager.
If getting command-line rsync up and running on a Windows box is a daunting task consider DeltaCopy, a free port.

Bacula as suggested by Autocracy is also an option, but the Storage Daemon typically needs a static IP (or a dynamic DNS entry) or you can expect backup failures when the clients can't connect to it.

Note that in either case you will need to either quiesce (shut down) MySQL or do a dump in order to get a good backup of your database.

voretaq7
  • 79,879
  • 17
  • 130
  • 214
  • thanks, i'm currently looking into bacula. imho rsync is a bad choice for me cause it's not really backing up anything but rather just making a synchronized copy. and with having mysql installed that synchronized copy may even be incomplete or broken. the Bacula thingy looks interesting. and yeas, i've already read that i'll still have to dump all databases even if i'm using incremental backup – Yervand Aghababyan Feb 08 '11 at 16:25
  • Bacula is an excellent tool (in fact I use it for my servers), but see my note above Re: the storage daemon needing a static IP. Also remember that all a "backup" is is a "synchronized copy" made at a particular point in time :-) – voretaq7 Feb 08 '11 at 16:32
  • He should run the storage daemon on the same machine he's backing up, and use the Windows machine to move the tape files that are done being written to. – Jeff Ferland Feb 08 '11 at 16:58
  • @Autocracy That's a good solution, but at that point he's back to rsync (or something similar) to move the virtual tapes -- Bacula is just a very powerful and convenient middleman (this is actually a great solution, we use a variant of it in my environment - it's just overkill for a lot of smaller cases) – voretaq7 Feb 08 '11 at 17:09
  • Well, if he were talking about just keeping a copy of his home directory, I'd say rsync alone is enough. A straight rsync solution doesn't provide for increments by period, and doesn't provide a mechanism to dump MySQL without layering another scripting layer on top. While rsync will cut down on bandwidth like the Bacula + rsync method would, I feel in his case the complication may be worthwhile. I think he has both arguments in full and can just decide what works for him from here... he knows more about what he needs than I do. :) – Jeff Ferland Feb 08 '11 at 17:55
  • thank you guys :) it's a pity i can't mark both your answers as best :) I just have installed bacula on my server and looks like it's configured and running. but how do i determine when to copy the tape files so they are not in a broken state? – Yervand Aghababyan Feb 08 '11 at 23:23
  • Well, the easy way is to just rsync them. Bacula always appends, so you can only be out the last backup. The fancy way is to write one job per file ("tape"), and query the database for files that are marked "done". – Jeff Ferland Feb 11 '11 at 16:24
  • rsync-ing the tapes is the easiest way to go IMHO - that's actually what we do here. As Autocracy pointed out Bacula always appends to the tape, so the transfer size is manageable. Our syste actually runs a script that does the rsync whenever a tape is unmounted, so the tapes at the remote site are always current, though sometimes it takes a while to sync the tapes over... – voretaq7 Feb 11 '11 at 16:55