2009-04-30 18:24:05
[I] app-admin/logrotate
Homepage: https://fedorahosted.org/logrotate/
Description: Rotates, compresses, and mails system logs
用于定时删除日志的
比如
zuroc@pippin /etc/logrotate.d $ cat /etc/logrotate.d/nginx
/log1/nginx/*_log {
daily
missingok 表示不存在也可以
copytruncate 表示copy+清空
dateext
rotate 60
compress
compresscmd /bin/bzip2
compressext .bz2
notifempty
sharedscripts
postrotate
if [ -f /var/run/nginx.pid ]; then \
/etc/init.d/nginx reload > /dev/null 2>&1 || true ; \
fi;
endscript
}
-----------------------------
用于当守护进程的 建了一个run脚本就可以了
当进程崩溃了 会自动重启
[I] sys-process/supervise-scripts
Homepage: http://untroubled.org/supervise-scripts/
Description: Starting and stopping daemontools managed services
[I] app-admin/logrotate
Homepage: https://fedorahosted.org/logrotate/
Description: Rotates, compresses, and mails system logs
用于定时删除日志的
比如
zuroc@pippin /etc/logrotate.d $ cat /etc/logrotate.d/nginx
/log1/nginx/*_log {
daily
missingok 表示不存在也可以
copytruncate 表示copy+清空
dateext
rotate 60
compress
compresscmd /bin/bzip2
compressext .bz2
notifempty
sharedscripts
postrotate
if [ -f /var/run/nginx.pid ]; then \
/etc/init.d/nginx reload > /dev/null 2>&1 || true ; \
fi;
endscript
}
-----------------------------
用于当守护进程的 建了一个run脚本就可以了
当进程崩溃了 会自动重启
[I] sys-process/supervise-scripts
Homepage: http://untroubled.org/supervise-scripts/
Description: Starting and stopping daemontools managed services