The previous article recorded the Yate learning--./yate/tools/log_rotate.sh;
Continue reading and Logging section of the script today./yate/packingyate.logrotate, first look at the script source code.
# Rotate the log and CDR files before each reaches 2GB in SIZE/VAR/LOG/YATE/VAR/LOG/YATE-CDR.TSV { size=100m< C3/>rotate 5 Missingok sharedscripts notifempty postrotate/bin/kill-hup '/bin/cat/var/run/ Yate.pid ' Endscript}
This is a log tool logrotate a script, to use the script, the script will be copied to the/etc/logrotate.d/folder inside the script can be used.
This script is roughly meant to be, and it's going to be checked every day.
/var/log/yate and <span style= "font-family: ' Microsoft Yahei '; font-size:10px; " >/VAR/LOG/YATE-CDR.TSV Two log files </span>
<pre name= "code" class= "CPP" >size=100m
If the log file is larger than 100M
<pre name= "code" class= "CPP" >rotate 5
Log file Rollback five times, is full of 100M log files, the date and log name of an old log file, the retention of 5 files, such as: yate-20150423
<pre name= "code" class= "CPP" >missingok
If the directory does not exist, the error will beMissingok for closing an error
<pre name= "code" class= "CPP" >sharedscripts
Represents <span style= "font-family: ' Microsoft Yahei '; font-size:10px; " >postrotate commands are only executed once after the log is compressed </span>
Notifempty
</pre><pre name= "code" class= "CPP" > Postrotate/bin/kill-hup '/bin/cat/var/run/yate.pid '
Command executed after rollback, restart Yate server, before performing log compression
Yate Study--./yate/packingyate.logrotate