On Mon, 17 Nov 2008 12:02:32 +1300
Roy Britten <[EMAIL PROTECTED]> wrote:
> I'm setting up a backup regime (database dump and file structure) from
> a server in the states. rsync seems a sensible tool, and I have a
> little experience with it. I've just come across rdiff-backup. It
> sounds useful, but I'd like to hear some war stories from folks who
> have used it before I go wandering into unknown territory.
>
> Anyone care to comment on rdiff-backup's ease of use (backing up *and*
> recovery), robustness, and the like?
>
> Thanks,
> Roy.
I just set up an automagic off-site backup for an os-commerce site I did the
back end work for, and used the simplest approach I could think of.
It's a 2 stage backup: first to a dedicated directory ( I use /backup, and
*EXCLUDE* this from the archive generation ), and then offsite. I do this
because the primary use for a backup is *NOT* disaster recovery, but to restore
a file accidentally deleted by manual intervention. ( I also use tar in verbose
mode, and save the output to a separate file that can be used to search for
said file before lumbering through the archive ).
The core to getting it offsite is...
-- 8< --
cd $ArchiveDir
$Echo "Database Backup" | $Nail -r [EMAIL PROTECTED] -s "client database backup
for $DateStamp" -a databases.$DateStamp.sql.zip $MailRecipient
# Sunday = day 0
if [ ! "$DayOfWeek" ]
then
$Split -a 1 -b 15m $Website.$DateStamp.zip $Website.$DateStamp.zip.
for Chunk in $Website.$DateStamp.zip.?
do
$Echo "Weekly Website Backup part $Chunk" | $Nail -r [EMAIL
PROTECTED] -s "client website backup for week commencing $DateStamp Part
$Chunk" -a $Chunk $M
ailRecipient
done
fi
-- 8< --
Requires a cli based mail client that can support attachments - I've used nail.
You also need to chunk the file up into sub-20MB chunks for gmail. Every
$<Command> above is a link to the full path of <command> ( and I even used zip
to keep the client happy! ).
As you can tell, a) the server's in the states and there's no bandwidth costs;
and b) I'm a firm believer in KISS. There's very little that can go wrong with
this, and even if it does, no existing data is corrupted.
The only other simple option for database backups is to replicate: usually very
little overhead ( commands are just run twice ). MySQL 5.x and PostgreSQL/slony
are pretty good solutions.
hth,
Steve
--
Steve Holdoway <[EMAIL PROTECTED]>