Date: Fri, 21 May 1999 16:53:42 +1000 (EST) From: Enno Davids <nconedd@mensa.national.com.au> To: graeme@echidna.com (Graeme Tait) Cc: enno.davids@metva.com.au, freebsd-isp@freebsd.org Subject: Re: Web Statistics break up program. Message-ID: <199905210653.QAA01984@mensa.national.com.au> In-Reply-To: <3745088D.61C@echidna.com> from "Graeme Tait" at May 21, 99 00:17:33 am
next in thread | previous in thread | raw e-mail | index | archive | help
| 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199905210653.QAA01984>