Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Location: Baltimore,MD,USA,Earth,Some Galaxy, We haven't gone that far!
Distribution: Redhat 7.3
Posts: 104
Rep:
Automatic email sending with sendmail?
I want sendmail to send me the weekly logs every sunday at 1 o' clock. Is there any way to do this?
Well, if there is a command for this, I can setup the cronjobs to schedule weekly, but the problem is I don't know if there is a command for this or not..
Thank you,
You can setup a cronjob to execute the following command:
sendmail email@address.com < filename
That will cat the file into an email which will end up in the designated email box. There are a bunch of flags you can use too in order to specify a subject or get verbose output to capture in a log file separate from cron messages.
You can test it out from the command line first and tweak it as you need.
Location: Baltimore,MD,USA,Earth,Some Galaxy, We haven't gone that far!
Distribution: Redhat 7.3
Posts: 104
Original Poster
Rep:
Thanks..
Can I expand my question a little bit?
Well, now, there is a script called "stats"
What I wanna do is, I want crontab to execute the stats like this, # stats /var/log/maillog
and have the output mailed to myself.
Can I do this also?
thank you much.
Location: Baltimore,MD,USA,Earth,Some Galaxy, We haven't gone that far!
Distribution: Redhat 7.3
Posts: 104
Original Poster
Rep:
Unfortunately it doesn't create a log file, that's what I'm concerned about.
The script is called sendmail Log analyzer, it's been written in PERL and a great way to check your sendmail logs..
You can click here for more information.
Well, the problem is, I have to execute it everytime I want to check the stats. Because It works if only executed at that time, it doesn't log anything..
Do I still have a chance,
Thank you much
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.