W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
自 3.1 版本以后,seaf-server 和 ccnet-server 支持通過接收 SIGUR1 信號來管理日志文件。
這個功能在你需要剪切日志文件但是不想關(guān)閉服務(wù)器的時候非常有用。
注意: 此功能在 Windows 下并不適用
對于 Debian, logrotate 默認(rèn)存儲在 /etc/logrotate.d/
假設(shè)你的 ccnet-server 的日志文件是 /home/haiwen/logs/ccnet.log
, ccnet-server 進(jìn)程的 pidfile 是 /home/haiwen/pids/ccnet.pid
. seaf-server's 的日志文件是 /home/haiwen/logs/seaf-server.log
, seaf-server 進(jìn)程的 pidfile 是 /home/haiwen/pids/seaf-server.pid
:
則請按如下配置 logroate:
/home/haiwen/logs/seaf-server.log
{
daily
missingok
rotate 52
compress
delaycompress
notifempty
sharedscripts
postrotate
[ ! -f /home/haiwen/pids/seaf-server.pid ] || kill -USR1 `cat /home/haiwen/pids/seaf-server.pid`
endscript
}
/home/haiwen/logs/ccnet.log
{
daily
missingok
rotate 52
compress
delaycompress
notifempty
sharedscripts
postrotate
[ ! -f /home/haiwen/pids/ccnet.pid ] || kill -USR1 `cat /home/haiwen/pids/ccnet.pid`
endscript
}
對于 Debian 用戶, 可以將以上配置文件存儲在 /etc/logrotate.d/seafile
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: