Hello,
next week I'll install logrotate on a centos 4.4 server via yum.
The man page says that the default mail command is /bin/mail -s, but there is no such binary on Centos.
I do have mutt installed, however, so I would like to use it. Ideally, I would like to have logrotate send logs with mutt as attachments like this:
mutt me@home.account -a compressed_log_file -s "here are your log files"
ie send the log as attachment, not email body. But the logrotate man page says:
--mail <command>
Tells logrotate which command to use when mailing logs. This command should accept two arguments: 1) the subject of the message, and 2) the recipient. The command must then read a message on standard input and mail it to the recipient.
so I have not clear how to make it use mutt as I want. Is it OK to say
--mail 'mutt me@home.account -a compressed_log_file -s "here are your log files"'
or will logrotate send the log in the email _body_?
I will check myself the first time logrotate runs, but I thought it would be nice to know if others are already usign mutt with logrotate and document here on the list the whole setup.
Thanks, M.
+++ M. Fioretti [2006-12-30 10:39:28]:
Hello,
next week I'll install logrotate on a centos 4.4 server via yum.
The man page says that the default mail command is /bin/mail -s, but there is no such binary on Centos.
yum install mailx
Kingsly
On Sat, Dec 30, 2006 17:15:24 PM +0530, Kingsly John (member+centos@kingsly.net) wrote:
next week I'll install logrotate on a centos 4.4 server via yum. The man page says that the default mail command is /bin/mail -s, but there is no such binary on Centos.
yum install mailx
Thanks. I _will_ do it if there really is no mutt solution, but I'd rather avoid it to keep the number of packages as small as possible, that's why I asked: since I already _have_ to have mutt on that box anyway...
Ciao, M.
+++ M. Fioretti [2006-12-30 13:29:45]:
On Sat, Dec 30, 2006 17:15:24 PM +0530, Kingsly John (member+centos@kingsly.net) wrote:
next week I'll install logrotate on a centos 4.4 server via yum. The man page says that the default mail command is /bin/mail -s, but there is no such binary on Centos.
yum install mailx
Thanks. I _will_ do it if there really is no mutt solution, but I'd rather avoid it to keep the number of packages as small as possible, that's why I asked: since I already _have_ to have mutt on that box anyway...
mutt -x <-- will enable compatibility with the "mail" command
"mail" is a system command (it's /bin/mail and not /usr/bin/mail) .. and lots of programs expect it to be present.
I don't know how you don't have the mail command on your system because it's needed by stuff like cron/at etc too.(or even logrotate for that matter)
Installing mailx is the best solution, your argument of not wanting to install extra packages doesn't exactly hold true in this case.
In all likelihood you currently have a broken system where you don't get any notification when cron/at jobs fail etc.
Kingsly
On Sat, Dec 30, 2006 20:43:48 PM +0530, Kingsly John (member+centos@kingsly.net) wrote:
I don't know how you don't have the mail command on your system because it's needed by stuff like cron/at etc too.(or even logrotate for that matter)
Then the logrotate rpm is broken (=missing a dependency)?
Installing mailx is the best solution, your argument of not wanting to install extra packages doesn't exactly hold true in this case. In all likelihood you currently have a broken system
hmmm, fair point. OK, mailx it is.
Thanks,
Marco