Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I have been "playing" with Linux for a while now, and I have a DNS and Postfix mailserver running on my LAN. The server has no contact with the outside world, which it shouldn't. It's just there for testing purposes. (I use Slackware 9.0)
My question is as follows:
All mail sent through the system is logged to /var/log/maillog
I did: grep to=< /var/log/maillog and this showed me basically what I wanted.
Is there a way to get the server to do the following:
Every night at 03:00 AM it runs a script or whatever it needs to.
This scripts retrieves all mail sent the previous day, from /var/log/maillog
It should only retreive the items from the day before. Otherwise it will be a lot of info in the end.
I have almost no experience in scripting or schedulig tasks on the server. If anyone can help point me in the right direction, I would really appreciate it.
This is very crude, but sends me info about all mail passing through the system.
Next I'll have to get bash to get yesterdays date, and filter out only those results as well.
ll get that working today.
You probably also have logrotate installed. I think you should check it out. You can configure it to daily rename your /var/log/messages. That way you won't have to filter out yesterdays results any more.
Yes, I have logrotate installed.
Hadn't even thought about that . A new log for every day is so much simpler, allthough it will give a lot of files in the end. But, by the time the files are that many, I hope I've learned enough bash-scripting to write a script that deletes or compresses the files older than say, a couple of months.
This will however not work at the first of the month. Instead of returning 30 or 31, it would return 0. I'll sit down some time and see if I can write a script to handle first of the month, and return correctly 30 or 31, whatever the case may be.