[NTLUG:Discuss] Suggestions for Backup software / schemes for LAMP web server(s)

Preston Hagar prestonh at gmail.com
Wed Oct 27 16:54:24 CDT 2010


On Tue, Oct 26, 2010 at 5:57 PM, David Simmons <dave at dgnal.net> wrote:
> Guys,
>
> Was wondering what everyone else is using (no need to reinvent the wheel) in
> regards to backup software/schemes for a LAMP web server.  Did some
> Googling, but came back with many discussion forums, etc and very
> professional (i.e. $$$$) online systems.  I'd like to copy my info from one
> server to another.
>
> Thanks in advance,
>
> -dave
>

I've been using a custom backup script for quite some time now for
multiple clients and it seems to work great.

Here is the script:

http://pastebin.com/FQ9zfyZZ

It uses rsync and cp -al to make daily snapshots so that you aren't
saving an unchanged file twice.  This example also backs up the /etc
and /var/www directories from a server called pbx as well.

It also requires a file at /root/cron_jobs/rsync-filter  with the
following contents:

- /dev/
- /lib/modules/*/volatile/
- /mnt/
- /proc/
- /sys/
- /var/lock/
- /var/run/

(complete like that, with the dashes, one entry per line)

you can add extra directories you don't care about backing up as well.
 The nice thing about the backup with the rsync filter is that you can
restore the complete system to a new disk, quickly and easily using
the methodology found here:

http://www.tolaris.com/2008/10/01/moving-your-linux-root-partition-to-raid/

I have done this (both in testing and after real disk failures)
multiple times and it consistently succeeds.  If you would rather
backup just your data and not the entire system, you can modify the
rsync line to just be the data directory you want.

Feel free to send me any questions you might have about it.  I like it
better than most "backup programs" since I don't really know what is
going on behind the scenes of a backup program, what it is really
doing and what it might be missing/corrupting, so I prefer this simple
method with fairly easy to understand commands.  I just put the file
on a server, put it in a cron job, and am done.

Hope this helps,

Preston



More information about the Discuss mailing list