Can I Clear MRS sudo Logs?

MRS sudo log files record operations performed by user omm and are helpful for fault locating. You can delete the logs of the earliest date to release storage space.

  1. If the log file is large, add the log file directory to /etc/logrotate.d/syslog to enable the system to periodically delete logs.

    Method: Run sed -i '3 a/var/log/sudo/sudo.log' /etc/logrotate.d/syslog.

  2. Set the maximum number and size of logs in /etc/logrotate.d/syslog. If the number or size of logs exceeds the threshold, the logs will be automatically deleted. By default, logs are aged based on the size and number of archived logs. You can use size and rotate to limit the size and number of archived logs, respectively. If required, you can also add daily/weekly/monthly to specify how often the logs are cleared.