[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
newbie: log rotation, compression and deletion
From: |
Philippe de Rochambeau |
Subject: |
newbie: log rotation, compression and deletion |
Date: |
Fri, 10 Jun 2005 15:27:26 +0200 |
Hello,
I need to rotate, compress and delete old copies of logs written to, by
on-going perl scripts.
When cfengine rotates logs, how does it know which applications/scripts
created the logs?
Assuming that it somehow figures out the name of the log-writing
applications/scripts (via a cfengine configuration file, perhaps), how
does it tell them to temporarily stop writing to the logs while
cfengine rotates them, compresses them, and deletes the old logs, and
to resume writing afterwards?
Do you need to write a HUP signal handler in your log-writing scripts
for cfengine to send signals to?
If so, could someone please provide examples of such HUP-signal
handlers?
How do you tell cfengine which compression program to use (compress,
gzip, etc.)?
I also need to compress and delete Apache logs which are created with
cronolog. Cronolog basically creates a new log file each day whose name
contains the current date.
How can I tell cfengine to compress and delete those logs without
rotating them?
How can I tell it to only compress log files whose names contain dates
greater than 7 days ago and less than 15 days ago? For instance,
Should be deleted:
log20050527.log
log20050528.log
Should be gzipped:
log20050529.log
log20050530.log
log20050531.log
Should be left as-is:
log20050601.log
log20050602.log
log20050603.log
log20050604.log
...
(cronolog renamed this file)
log20050610.log
Many thanks.
Philippe
- newbie: log rotation, compression and deletion,
Philippe de Rochambeau <=