ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cvsroot/thttpd/scripts/500.thttpd-rotate
Revision: 1.1
Committed: Mon Jun 18 21:11:58 2001 UTC (25 years, 3 months ago) by root
Branch: MAIN
CVS Tags: mp_j, dp_j, cp_j, HEAD
Branch point for: connpatch, dirpatch, mmapppatch
Error occurred while calculating annotation data.
Log Message:
*** empty log message ***

File Contents

# Content
1 #!/bin/sh
2 #
3 # thttpd-rotate - nightly script to rotate thttpd's log files on FreeBSD 3.x
4 #
5 # This goes in /etc/periodic/daily. It rotates the log files and then
6 # tells thttpd to shutdown cleanly. The wrapper script will then start
7 # up a new copy, writing to the new log file.
8
9 cd /usr/local/www/logs
10 rm -f thttpd_log.7
11 mv thttpd_log.6 thttpd_log.7
12 mv thttpd_log.5 thttpd_log.6
13 mv thttpd_log.4 thttpd_log.5
14 mv thttpd_log.3 thttpd_log.4
15 mv thttpd_log.2 thttpd_log.3
16 mv thttpd_log.1 thttpd_log.2
17 mv thttpd_log thttpd_log.1
18 pid1=`cat /var/run/thttpd.pid`
19 kill -USR1 "$pid1"
20 sleep 60
21 pid2=`cat /var/run/thttpd.pid`
22 if [ "$pid2" -eq "$pid1" ] ; then
23 kill -KILL "$pid1"
24 fi