首页 > 利用Logrotate实现weblogic日志每日备份

利用Logrotate实现weblogic日志每日备份

想利用Logrotate实现对nohup.out日志的每日备份,nohup.out是通过nohup命令生成的weblogic应用日志,配置完成后直接执行“ /usr/sbin/logrotate /etc/logrotate.conf” 命令,没有生成任何备份文件,也没有报错提示,logrotate.conf中内容如下:

/home/bea1/basedomain/bin/nohup.out{
daily
prerotate
/usr/bin/chattr -a /home/bea1/base
domain/bin/nohup.out
endscript
copytruncate
create mode owner group nohup.out.date +%Y%m%d%H%M
olddir /home/bea1/basedomain/bin
rotate 1
postrotate
/usr/bin/chattr +a /home/bea1/base
domain/bin/nohup.out
endscript
}


可能是因为权限问题,我修改为以下内容后可以执行成功
/home/bea1/basedomain/bin/nohup.out{
daily
copytruncate
dateext
olddir /home/bea1/base
domain/bin
nocompre
rotate 100
}

【热门文章】
【热门文章】