Log Rotate and *NIX

This has changed since my days at Pyramid. There has been quite a lot of thinking and engineering about dealing with daemon logs. The places to look are via the syslogd, newsyslog project, you can see a the newsyslog man pages and using the keyword “rotate log”. The idea is that logs are rotated, although the names are not and that old logs are deleted. So the newest is called mypackage or mypackage.0 and the older logs increment the counter. Logs are generally kept in /var/log or /var/log/package_name and not in the package or product install tree. What a nob? There is a command ‘logrotate’; it can be installed using macports. It needs a a configuration file.

Daemons

Or Liunux/MacOS out of the box, I found these pages

Batch Programs

I have a problem today, I want to run a script periodically, on a laptop which will create a run log and I want to keep the logs tidy but each run is to have one log. I think I’ll write a function file since newlog is designed for daemons and I would need to manage the problem that my run needs to test the target log is empty before writing. I think I’ll refactor my functions to use logrotate.

Related Posts

  • Upgrading MacOS X And on to 10.9 There was a rumour that it was best to stop at 10.8, Mountain Lion but […]
  • RCS Revision Control System, one of the grand daddies of them all. I still use it because […]
  • Mavericks a.k.a. MacOS X.9 I said in my article on upgrading MacOS that this was easy to do, it […]
  • Job Control It seems that Mac have begun to decrement cron and recommend the use of launchd for job […]
  • Centos 6.x I downloaded this from http://centos.mirroring.pulsant.co.uk/6.4/isos/x86_64/ The […]

One thought on “Log Rotate and *NIX

Leave a Reply

Your email address will not be published. Required fields are marked *