rotate_mtx_logs.py
The rotate_mtx_logs.py script runs the logrotate command from $MTX_LOG_DIR.
Syntax
rotate_mtx_logs.py [-h] [ -c LOGROTATECONFIGFILE] [ -i TIMEINTERVALINSECS] [-s LOGROTATESTATUSFILE]
Options
The rotate_mtx_logs.py script has the following command line options:
- -h, --help
- Show this help message and exit.
- -c LOGROTATECONFIGFILE, --logrotate_config_file=LOGROTATECONFIGFILE
- Configuration file used by logrotate. Default is /opt/mtx/conf/logrotate_mtx.conf
- -i TIMEINTERVALINSECS, --time_interval_in_seconds=TIMEINTERVALINSECS
- Time interval in seconds to run logrotate. Default is 3600 seconds.
- -s LOGROTATESTATUSFILE, --logrotate_status_file=LOGROTATESTATUSFILE
- Status file used by logroate. Default is ./logrotate.status.
To pass a different command line option, you can add a line similar to the following line in the process_ctrl_cfg_sed.extra file, which configures logrotate to run every
five seconds and uses a different logrotate configuration file:
s@service \(.*\) rotate_mtx_logs.py@service \1 rotate_mtx_logs.py -i 5 -c /opt/mtx/conf/my_logrotate_mtx.conf@
Note: The custom logrotate file can be added to a configuration source. The filename pattern must be
*logrotate*.conf.
To disable this function, include the following line in
process_ctrl_cfg_sed.extra
file:
s@service \(.*\) rotate_mtx_logs.py@#service \1 rotate_mtx_logs.py@