Re: [Hampshire] Auto-email MySQL Database dump

Top Page

Reply to this message
Author: Jacqui caren
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] Auto-email MySQL Database dump
Victor Churchill wrote:
> script_to_generate_export_on_stdout | mail -s "DB Dump taken at
> `date`" user@???


One suggestion - consider base64 uuencoding or even just QP encoding
as content MAY get munged if it passed through MTA's.

We recently had a case where a milter replaced 'From ' at the
beginning of a line with '>From ' and another case where a
MTA replaced all '\n' with '\r\n'. In another case SpamAssassin
badly screwed up the headers and content.

OK there are ways around this but you should assume bad stuff happens
and a simple encoding helps.

Another problem you may hit is message size limitations.
In the bad old days before reliable FTP we used to split
a file into parts and deliver each part. The same technique
is still used in binary newsgroups such as
alt.binaries.pictures.amnimals to upload large photos.

If the backup is important use a signed compressed archive
then split and email no more than 1meg parts (after b64/uue)
twice to your email account.

Writing a filter to process the parts back into the tgz or
zip file is not too painfull.

Jacqui

FYI: I use scp and rsync under crontab.
One cron job ould run the dump, tgz it then
rsync it and other files such as logs to
an offsite backup.