/var/adm/wtmpx を logadm でローテーションする
By msysh on 2011-06-02
# vi /etc/logadm.conf /var/adm/wtmpx -C 6 -a /usr/lib/acct/utmp2wtmp -b /usr/lib/acct/closewtmp -c -g adm -m 664 -o adm -p 1d -z 0
rotate listener log (Oracle)
By msysh on 2011-01-17
#!/bin/bash ORACLE_HOME=${ORACLE_HOME:-/opt/app/oracle/product/10.2.0/db_1} SUFFIX=`date -d "1 month ago" +"%Y%m"` LISTENER_LOG_FILE=listener_`hostname | tr '[A-Z]' '[a-z]'` LISTENER_LOG_DIR=${ORACLE_HOME}/network/log cd ${LISTENER_LOG_DIR} ${ORACLE_HOME}/bin/lsnrctl set log_file ${LISTENER_LOG_FILE}.tmp.log /bin/mv ${LISTENER_LOG_FILE}.log ${LISTENER_LOG_FILE}.${SUFFIX}.log ${ORACLE_HOME}/bin/lsnrctl set log_file ${LISTENER_LOG_FILE}.log /bin/cat ${LISTENER_LOG_FILE}.tmp.log >> ${LISTENER_LOG_FILE}.${SUFFIX}.log /bin/tar zcf ${LISTENER_LOG_FILE}.${SUFFIX}.log.tar.gz ${LISTENER_LOG_FILE}.${SUFFIX}.log /bin/rm -f ${LISTENER_LOG_FILE}.tmp.log /bin/rm -f ${LISTENER_LOG_FILE}.${SUFFIX}.log exit 0
cacti.log のローテーション
By msysh on 2011-01-17
# vi /etc/logrotate.d/cacti ${CACTI_HOME}/log/cacti.log { weekly rotate 4 compress missingok copytruncate } # logrotate -f /etc/logrotate.d/cacti
VMware ESX 2.5.X vmware.log のローテーション
By msysh on 2010-12-24
VMware ESX 2.5.X vmware.log のローテーション http://kb.vmware.com/selfservice/search.do?cmd=displayKC&docType=kc&externalId=8182749 # ログのサイズ(バイト単位で指定。下記の場合100KByte) log.rotateSize = "100000" # ログファイルを残しておく世代 log.keepOld = "10"