mysql dump via email...

Hi…

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/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.

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?

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

@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 6.0 has mailx 12.4

CentOS 5.6 don't want to tell me the version :D

ok, just solved using mutt instead of mailx…

bye bye mailx.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct