File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / thttpd / scripts / 500.thttpd-rotate
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Tue Feb 21 17:21:13 2012 UTC (12 years, 3 months ago) by misho
Branches: thttpd, MAIN
CVS tags: v2_25b, HEAD
thttpd

#!/bin/sh
#
# thttpd-rotate - nightly script to rotate thttpd's log files on FreeBSD
#
# This goes in /etc/periodic/daily.  It rotates the log files and then
# tells thttpd to re-open its log file.

cd /usr/local/www/chroot/logs
rm -f thttpd_log.7
mv thttpd_log.6 thttpd_log.7
mv thttpd_log.5 thttpd_log.6
mv thttpd_log.4 thttpd_log.5
mv thttpd_log.3 thttpd_log.4
mv thttpd_log.2 thttpd_log.3
mv thttpd_log.1 thttpd_log.2
mv thttpd_log thttpd_log.1
kill -HUP `cat /var/run/thttpd.pid`

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>