]> git.gir.st - ttxd.git/blob - src/thttpd-2.27/scripts/500.thttpd-rotate
initial code import
[ttxd.git] / src / thttpd-2.27 / scripts / 500.thttpd-rotate
1 #!/bin/sh
2 #
3 # thttpd-rotate - nightly script to rotate thttpd's log files on FreeBSD
4 #
5 # This goes in /etc/periodic/daily. It rotates the log files and then
6 # tells thttpd to re-open its log file.
7
8 cd /usr/local/www/chroot/logs
9 rm -f thttpd_log.7.gz
10 mv thttpd_log.6.gz thttpd_log.7.gz
11 mv thttpd_log.5.gz thttpd_log.6.gz
12 mv thttpd_log.4.gz thttpd_log.5.gz
13 mv thttpd_log.3.gz thttpd_log.4.gz
14 mv thttpd_log.2.gz thttpd_log.3.gz
15 mv thttpd_log.1.gz thttpd_log.2.gz
16 mv thttpd_log thttpd_log.1
17 kill -HUP `cat /var/run/thttpd.pid`
18 sleep 1
19 gzip -f thttpd_log.1
Imprint / Impressum