Results 1 to 7 of 7

Thread: logrotate send using attachment

  1. #1
    Join Date
    Apr 2013
    Beans
    29

    Question logrotate send using attachment

    Ubuntu 12.10
    Squid3 3.1
    Dansguardian 2.10.1.1
    Postfix 2.9.6
    Webmin 1.620
    Logrotate 3.7.8

    I have logrotate setup to send me the log files from Squid3 via email. Even though it works just fine, the log files aren't sent as attachments but rather the entire log files contents are within the message body. Is there a way to send these log files as attachments?
    Last edited by bullet333; May 13th, 2013 at 04:35 PM.

  2. #2
    Join Date
    Nov 2012
    Location
    Halloween Town
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: logrotate send using attachment

    Even though I'm not completely sure because I haven't use it in years, I don't remember logrotate having the ability about sending mailing as attachments, but you could take a look at logrotate man page to confirm it.

    Creating e-mail messages, including adding attachments or signatures, is the function of a mail user agent (MUA). If you have the mail user agent mutt (or can install it), it should be able to do what you want, just write a separate script to E-mail attachments using
    Code:
    mutt -s

  3. #3
    Join Date
    Apr 2013
    Beans
    29

    Re: logrotate send using attachment

    Thanks for the reply, but the reason I'm using logrotate is because I don't know how to script. I'm a linux noob.

    I might stop emailing the Squid log files anyways because they're available via Webmin more user friendly. I was thinking of keeping the Squid logs but I don't think I need to. The only other log file I'm watching is the syslog. You think there's any other logs I should be watching on my system? Maybe kernel?

  4. #4
    Join Date
    Feb 2007
    Location
    West Hills CA
    Beans
    10,048
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: logrotate send using attachment

    What files you watch depends on what is important in terms of performance of your servers. If all you care about is uptime, then install rwho and rwhod and periodically use ruptime to make sure your system is up and running. You want to make sure you don't run out of disk space (df -h) and you need an UPS to keep the power going. The UPS can send emails or text messages when the power goes out. Other than that, you really don't need all of the data in log files, until there is a problem. You can also send the syslog data to another linux machine's syslog and filter the messages that get sent using rsyslog.conf:

    Code:
    man rsyslog.conf
    Scripting is a useful skill to have when running servers.
    -------------------------------------
    Oooh Shiny: PopularPages

    Unumquodque potest reparantur. Patientia sit virtus.

  5. #5
    Join Date
    Nov 2012
    Location
    Halloween Town
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: logrotate send using attachment

    Quote Originally Posted by tgalati4 View Post
    What files you watch depends on what is important in terms of performance of your servers...
    tgalati4 is right, and besides what he has posted I would recommend you a read on Linux Log Files., especially the System Logs and Application Logs items.

  6. #6
    Join Date
    Apr 2013
    Beans
    29

    Re: logrotate send using attachment

    Thanks for all the great information! I'm currently using Monit to monitor the services, system, and disk usage.

  7. #7
    Join Date
    Nov 2012
    Location
    Halloween Town
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: logrotate send using attachment

    Glad you got it working. Please mark your thread as solved if you think it provides a working solution for your problem.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •