Tools to trim log files out of a logged directory. This is to prevent obvious issues such as flooding a machine with logs.
You'll set logtrimmer.py
to run on a daily basis (weekly would work fine as well). You'd change the config.yaml
file so that it knows the directry to target, the names of the log files, and how many log files you want to keep.
Take a look at config.yaml
it should explain it pretty well
Set everything up, then import the python script and run trim_log_files(test=True)
, that way it will only tell you what it's going to do.
Add the com.log.trimmer.plist
file to your plist, or use some other automated method to start up the file. It will look for the config file in the same folder that the python script is in.
Have not used it here yet, please give me a PL with some instructions.