Who sez you have to 'implement'
anything?
Most Linuxes use a
logrotate program which is run every day (via
cron ... see
/etc/crontab) to archive older log-files.
For example, in my
/var/log directory, I see not only
messages but also
messages.2.gz. That's the log-rotate program at work... renaming the files, compressing them, and keeping only the last so-many of them.
The
cron facility is
already "watching the days go by," so you can simply create a program for it to run at periodic intervals. And the program that you need might
be the already-existing
logrotate program.
Quote:
|
Dictum Ne Agas: "Do Not Do A Thing Already Done."
|