[Orca-users] RE[2]: Apache access_log is a symbolic link

Rusty Carruth rcarruth at tempe.tt.slb.com
Thu Jan 31 06:58:42 PST 2002


dtitzer at servicebench.com wrote:
>  
> The "cronolog" utility is configured into the Apache config file as a piped
> command instead of a path to the log file. The cronolog utility watches the
> size of the log file, the date/time, etc., and rolls over to a new file.
> Before, it was necessary to kill Apache, move the log, then restart it. 
>  
> Cronolog is a more elegant solution, but it breaks orcallator.se's file
> watching. I was able to fix the problem temporarily by restarting
> orcallator, but unless cronolog is configured to roll over by date and time
> at a particular time (and uses file size instead), I'll be unable to
> schedule an orcallator restart to continue capturing log information when
> the symbolic link target changes.
>  
> -dat
>  

Well, not technically accurate, kinda.   ;-)

You could do the kind of dumb trick I did at home when trying to keep
my internet connection up - run a cron job every <x> minutes that checks
to see if the event that you want to fixup happened, and fix it up.

Or, run a script in the background that watches for the event and
then fires up whatever.

Yes, its a hack, but at least it will work.

Something stupid like this:

#!/bin/sh

prevfile=`ls -l /the/file| awk '{print $5 " " $6 " " $7 " " $8}'`

while : ; do
	sleep 60
	nowfile=`ls -l /the/file| awk '{print $5 " " $6 " " $7 " " $8}'`
	if ("$nowfile" -ne "$prevfile) then
		do.whatever
		$prevfile="$nowfile"
	fi
done

or similar if you want a cron job (but save the 'state' in a file,
something stupid like 
	ls -l /the/file > /tmp/$$.curstuff

and use diff to compare the two files...

Dumb, but it works...

(and much easier than writing a 'reverse cronolog' program!)

rc



More information about the Orca-users mailing list