vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| rcee wrote: > Hi Every body , > > How will i rotate the system logs - AIX 5.2 . > > for eg - /etc/security/failedlogin > - /var/adm/wtmp > -/var/adm/sulog > For these, you could create a shell script that runs in cron and monitors the size of the file and then rotates it when it exceeds a certain high watermark. For example, we made the following for the wtmp file that used to get really large when we had noise tty serial lines in a poor quality environment: #!/bin/ksh integer FSIZE=$(ls -l /var/adm/wtmp|awk '{ print $5 }') if test ${FSIZE} -gt 1000000 then /bin/mv /var/adm/wtmp /var/adm/wtmp.old echo "$(date +"%b %e %T") $(uuname -l) old /var/adm/wtmp has been saved." >> ${MYLOG} /usr/sbin/acct/nulladm /var/adm/wtmp echo "$(date +"%b %e %T") $(uuname -l) new /var/adm/wtmp has been primed." >> ${MYLOG} fi |
| ||||
| Hi again. Forgot to mention that you could prime the wtmp file and set the permissions properly using the touch or redirection methods, but the nulladm command is supposedly the correct approach for these files according to IBM, which is why we do it that way. Steve |