From owner-freebsd-isp Thu May 20 23:54:40 1999 Delivered-To: freebsd-isp@freebsd.org Received: from mensa.national.com.au (mensa.national.com.au [203.57.240.81]) by hub.freebsd.org (Postfix) with ESMTP id 06195158A0 for ; Thu, 20 May 1999 23:54:36 -0700 (PDT) (envelope-from nconedd@mensa.national.com.au) Received: (from nconedd@localhost) by mensa.national.com.au (8.8.8+Sun/8.8.8) id QAA01984; Fri, 21 May 1999 16:53:42 +1000 (EST) From: Enno Davids Message-Id: <199905210653.QAA01984@mensa.national.com.au> Subject: Re: Web Statistics break up program. To: graeme@echidna.com (Graeme Tait) Date: Fri, 21 May 1999 16:53:42 +1000 (EST) Cc: enno.davids@metva.com.au, freebsd-isp@freebsd.org In-Reply-To: <3745088D.61C@echidna.com> from "Graeme Tait" at May 21, 99 00:17:33 am X-Mailer: ELM [version 2.5 PL0a3] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-isp@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org | Enno Davids wrote: | | > So, the middle of the loop above wants to be something like... | > | > mv ${log} ${log}"_tmp" | > cp /dev/null ${log} | > chown www ${log} | > apachectl restart | > mv ${log}"_tmp" ${ARCDIR}/${log}.${DAY} | | | Why are the steps | | > cp /dev/null ${log} | > chown www ${log} | | necessary? Strictly they may not be of course. Its more of a form thing for me. When I'm just truncating a log file (which we don't do much of these days of course) I tend to just cp /dev/null to it, which preserves mode and ownership. That leads to doing something similar when I recreate it from scratch, namely a copy with a following chown and a chmod. Doing this can often save you from odd problems when the rotate script runs as a user other than that of the Webserver. Often such script may run as root and creating a new file with cp or touch from that environment will often leave you with a file the Webserver can't write to. Enno. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-isp" in the body of the message