Update logrotate

This commit is contained in:
plt 2021-08-12 11:43:37 +08:00
parent 30594a2806
commit 527d6e8d46

View File

@ -2,8 +2,7 @@
## How it works
seaf-server, ccnet-server (since version 3.1) and seafile-controller (since version 6.0.8) support reopenning
logfiles by receiving a `SIGUR1` signal.
seaf-server and seafile-controller support reopenning logfiles by receiving a `SIGUR1` signal.
This feature is very useful when you need cut logfiles while you don't want
to shutdown the server. All you need to do now is cutting the logfile on the fly.
@ -14,11 +13,8 @@ For debian, the default directory for logrotate should be `/etc/logrotate.d/`
## Sample configuration
Assuming your ccnet-server's logfile is `/home/haiwen/logs/ccnet.log` and your
ccnet-server's pidfile for ccnet-server is `/home/haiwen/pids/ccnet.pid`.
Assuming your seaf-server's logfile is setup to `/home/haiwen/logs/seafile.log` and your
seaf-server's pidfile for seaf-server is setup to `/home/haiwen/pids/seaf-server.pid`:
seaf-server's pidfile is setup to `/home/haiwen/pids/seaf-server.pid`:
The configuration for logrotate could be like this:
@ -37,20 +33,6 @@ The configuration for logrotate could be like this:
endscript
}
/home/haiwen/logs/ccnet.log
{
daily
missingok
rotate 15
compress
delaycompress
notifempty
sharedscripts
postrotate
[ ! -f /home/haiwen/pids/ccnet.pid ] || kill -USR1 `cat /home/haiwen/pids/ccnet.pid`
endscript
}
/home/haiwen/logs/index.log
{
monthly
@ -64,4 +46,4 @@ The configuration for logrotate could be like this:
```
You can save this file, in debian for example, at `/etc/logrotate.d/seafile`.
You can save this file, in Debian for example, at `/etc/logrotate.d/seafile`.