oracle监听日志保留时间,Oracle Solaris 10修改系统日志保留时间

logadm -C 4 -c -s 300m -w /var/adm/wtmpx

//    -C count     Delete the oldest versions until there are not more than count files left.

//    -p period    Rotate a  log  file  after  the  specified  time  period  (period) .

//    -c           Rotate the log file by copying it and truncating the original  logfile to zero length, rather than renaming the file.

//    -w entryname Write an entry into the config file (that is, /etc/logadm.conf)

//    -s size      Rotate the log file only if its size is greater than or equal to size.

//    -z count     Compress old log files after all other commands have been executed.

tail -1 /etc/logadm.conf

wtmpx -C 4 -c -s 300m /var/adm/wtmpx

logadm -v

–lines omitted–

processing logname: /var/adm/wtmpx

#     using default template: file.file.file.n

mkdir -p /var/adm # verify directory exists

cp -fp /var/adm/wtmpx /var/adm/wtmpx.0 # rotate log file via copy (-c flag)

cp -f /dev/null /var/adm/wtmpx # trucate log file (-c flag)

touch /var/adm/wtmpx

chown 4:4 /var/adm/wtmpx

chmod 644 /var/adm/wtmpx

#     recording rotation date Tue Feb 25 13:51:14 2014 for /var/adm/wtmpx

writing changes to /var/logadm.conf

ls -l /var/adm/wtmpx*

-rw-r–r--   1 adm      adm            0 Feb 25 13:51 /var/adm/wtmpx

-rw-r–r--   1 adm      adm    362328000 Feb 25 12:54 /var/adm/wtmpx.0

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值