Housekeeping
Log cleaning in DMK
dbi services provides a cleaning script named housekeeping.py
that performs several types of operations on log files.
Deletion of old files
Truncation of files
Compression of old files
Archiving of files (truncation + compression)
The script should be run as housekeeping.py -c $MONGO_BASE/etc/housekeeping.conf
. You can find a template for the housekeeping.conf
file in $DMK_HOME/templates/etc/housekeeping.conf
.
Default settings
You can set default settings for the main operations with the DEF
keyword:
DEF::DELET::100:: # Delete files older than 100 days
DEF::TRUNC::1000:: # Keep the last 1000 lines
DEF::ARCHI::1000:: # Backup the file and keep the last 1000 lines
DEF::COMPR::100:: # Compress files only if older than 100 days
Custom settings
You can define custom paths that you want to be cleaned with the CST
keyword:
CST::/u01/app/mongodb/local/dmk/logs/js/*.js::DELET::1:: # Delete JS files older than one day, to clean DMK internal folder.
For MongoDB log file, you should use the logrotate utility and not the housekeeping.py
tool !
Last updated