Troubleshooting and Maintenanc...
Kron PAM Log Rotation and Deleting Old Logs
1 min
log rotation is the mechanism that archives an active log file (e g , catalina 01 01 2020 out) and initializes a fresh one (e g , catalina out) for continued logging without periodic cleanup, these archived log files accumulate over time and may gradually consume significant disk space to remove outdated log files, use the bash script below for continuous maintenance, it is recommended to schedule this script as a cron job , ensuring automated log cleanup at regular intervals \#!/bin/bash #time threshold to delete files (days) the files older than this threshold will be deleted threshold=90; find /pam/logs/ type f mtime +$threshold exec rm {} ; find /pam/mobile/log/ type f mtime +$threshold exec rm {} ; find /pam/nssoapp/log/ type f mtime +$threshold exec rm {} ; find /pam/sql/log/ type f mtime +$threshold exec rm {} ; find /pam/sftp/log/ type f mtime +$threshold exec rm {} ; find /var/log/messages type f mtime +$threshold exec rm {} ;