mysql dump via email...
I use this cron
> #!/bin/bash
dt=
date +%Y_%m_%d
/usr/bin/mysqldump -ce –user=username --password=password DBname| gzip | uuencode DATAdump$dt.\
sql.gz | mail -s '[Label] Database backup '$dt
support@mydomain.org
to schedule a mysqldump and send the dump via email to an email address.
This cron works since years but now it doesn't attach the dump as a file but it sends the scrambled dump in the message body.
Why?
Is it something related to uuencode, if yes what is the problem now?
Running CentOS 6.
5 Replies
@sblantipodi:
Hi…
I use this cron
> #!/bin/bashdt=
date +%Y_%m_%d
/usr/bin/mysqldump -ce –user=username --password=password DBname| gzip | uuencode DATAdump$dt.\
sql.gz | mail -s '[Label] Database backup '$dt
support@mydomain.org to schedule a mysqldump and send the dump via email to an email address.
This cron works since years but now it doesn't attach the dump as a file but it sends the scrambled dump in the message body.
Why?
Is it something related to uuencode, if yes what is the problem now?
Running CentOS 6.
It looks like the intention of the command is to place the uuencoded data directly in the email body.
I suppose the mail client is supposed to handle the uuencoded data as an attachment (although the modern way of attaching files to email is to use MIME parts).
Have you changed mail client software?
On centos 5.6 I use dovecot+postfix+amavisd
On centos 6 I use dovecot+postfix
@sblantipodi:
I don't changed the email client, its thunderbird latest, the strange things is that the script work well on CentOS 5.6.
On centos 5.6 I use dovecot+postfix+amavisd
On centos 6 I use dovecot+postfix
If anything I think it could be the "mail" command (mailx?) that behaves differently in centos 6.
What version did you have before and what do you have now?
Can you show the full raw mail contents of an old email and a current one? (at least until the attachment data begins)
CentOS 5.6 don't want to tell me the version
bye bye mailx.