ok here goes
man cron
man crontab
this will show you at to setup a crondaemon to run

Here is how i use it
first i have a crontab setup as follows
0 5 * * * /usr/local/analog/analog/wwwaccess.ksh
then i have this script as follows

--------------------------------------------------------------------------------------------
#!/bin/ksh
# The following turns on and off report generators 1=on anything else=off
# I actually have about 15 different but i shortened it for here
ACCESS=1

# Do not touch the following variables they are needed by the scripts
#some of the variable aren't needed for you probably and you will probably
need to chage PATH CONFIGFILE
PATH=$PATH:/usr/local/bin:/usr/local/analog/analog:.
HTMLDIR=/usr/local/apache/docs/report
if [ ! -d $HTMLDIR]
then
mkdir -p $HTMLDIR
fi
cd /usr/local/analog/analog        #probably doesn't need to be there but
well I haven't rewritten this in almost a year
DDATE=`date '+%d'`
MMONTH=`date '+%b'`
YMONTH=`TZ=TZ+28 date '+%b'`
YYMONTH=`TZ=TZ+52 date '+%b'`
DDAY=`TZ=TZ+28 date '+%d'`
DDDAY=`TZ=TZ+52 date '+%d'`
YNMON=`TZ=TZ+28 date '+%m'`
YYNMON=`TZ=TZ+52 date '+%m'`
YEAR=`TZ=TZ+28 date '+%Y'`
YYEAR=`TZ=TZ+52 date '+%Y'`
TYEAR=`date '+%Y'`
TMONTH=`date '+%M'`
TDAY=`date '+%d'`
if [ ! -d $HTMLDIR/$TYEAR/$TMONTH/$TDAY ]
then
mkdir -p $HTMLDIR/$TYEAR/$TMONTH/$TDAY
fi

#Yeah some of the previous isn't used here but it is in my full script just
comment them out if not needed

if [ ! -d /usr/local/analog/analog/config ]
then
mkdir -p /usr/local/analog/analog/config
fi

CONFIGFILE=/usr/local/analog/analog/config/analog.$MMONTH.$DDAY.$TYEAR


if  [ $DDATE = 01 ]
then
DDATE=`echo $DDAY + 1 |bc`
fi



for i in $DDAY
#here is the for statement from the below comments


do

k=`echo $DDATE - $i|bc`
l=`echo $DDATE - $i|bc`
l=`echo $l + 1 |bc`
if [ "$k" -lt "10" ]
then
k=0$k
fi
if [ "$l" -lt "10" ]
then
l=0$l
fi


# Web Access Logs report generator  this created another config file
everyday and then removes it the reason for this for me anyway
# is because once in a while the logs don't get moved correctly so just for
that month you can edit the for loop before hand and change it
# to say 01 02 03 and then run this and it would produce back days you
would probably need to change
# LOGFILE previous and OUTFILE also HOSTFLOOR (We get over 500,000 distinc
hosts and most of them have less then 1000 requests
#so we only want to show the top too 200  also change HOSTNAME to whatever
the webserver name is
if [ "$ACCESS" = "1" ]
then
echo "Access reports turned on"
>$CONFIGFILE
echo "HOSTNAME weserver" >>$CONFIGFILE
echo "FROM -00-00-$l:2359" >>$CONFIGFILE
echo "TO -00-00-$k" >>$CONFIGFILE
echo "LOGFILE /logs/www_access/$YMONTH/access.*." >>$CONFIGFILE
echo "OUTFILE $HTMLDIR/analysis.%M%D%Y.%H%n.html" >>$CONFIGFILE
echo "HOSTFLOOR -200r" >>$CONFIGFILE
/usr/local/analog/analog/analog +g$CONFIGFILE >>/var/analog.log 2>&1
rm $CONFIGFILE
else
echo "Access reports turned off"
fi

done


--------------------------------------------------------------------------------------------



analog.cfg  put this in addition to anything else
STATUSINCLUDE 200-
GENSUMLINES ALL
GENSUMLINES -BCKLNE
PNGIMAGES OFF
304ISSUCCESS ON
#FROM -00-00-02:2359
#TO -00-00-01
IMAGEDIR /images/
LOGO /images/logo.gif
DEBUG ON
SETTINGS ON
#WARNINGS -LMFDC
RUNTIME ON
LASTSEVEN OFF
HTMLPAGEWIDTH 100
OUTPUT HTML
BARSTYLE g
GENERAL ON
MONTHLY OFF
WEEKLY OFF
FULLDAILY OFF
DAILY OFF
FULLHOURLY OFF
HOURLY ON
QUARTER OFF
FIVE OFF
HOST ON
ORGANISATION OFF
DOMAIN OFF
REQUEST ON
DIRECTORY OFF
FILETYPE ON
SIZE OFF
PROCTIME OFF
REDIR ON
FAILURE ON
REFERRER ON
REFSITE OFF
SEARCHQUERY ON
SEARCHWORD OFF
REDIRREF OFF
FAILREF ON
FULLBROWSER OFF
BROWSER ON
BROWSERREP OFF
BROWSERSUM ON
OSREP ON
VHOST OFF
USER OFF
FAILUSER OFF
STATUS ON
SEARCHQUERYFLOOR 1r
SEARCHWORDFLOOR 1r
FULLBROWFLOOR 1r
BROWFLOOR 1r
OSFLOOR 1r
STATUSFLOOR 1r
FAILREFFLOOR 1r
TYPEFLOOR 1r
FAILFLOOR 1r
REDIRFLOOR 1r
REFFLOOR 1r
REQFLOOR 10r
HOSTSORTBY REQUESTS
TIMECOLS RrPpBb
FAILREFCOLS NRrPpBb
REFCOLS NRrPpBb
SEARCHQUERYCOLS NRrPpBb
BROWREPCOLS NRrPpBb
BROWSUMCOLS NRrPpBb
OSCOLS NRrPpBb
STATUSCOLS NRrPpBb
TYPECOLS NRrPpBb
REDIRCOLS NRrPpBb
FAILCOLS NRrPpBb
REQCOLS NRrPpBb
HOSTCOLS NRrPpBb
ALLGRAPH R
SUBDIR */
SUBDIRFLOOR 1:r
SUBDIRSORTBY REQUESTS
SUBBROW *
SUBBROW Mozilla/*.*
SUBBROW MSIE/*.*






"James Fielding" <[EMAIL PROTECTED]>@lists.isite.net on 09/14/2001
12:07:37 PM

Please respond to [EMAIL PROTECTED]

Sent by:  [EMAIL PROTECTED]


To:   <[EMAIL PROTECTED]>
cc:

Subject:  [analog-help] automating reporting problem.....


Hello,

I have posted before but I'll be a bit more specific with my query.

I am quite new to unix systems and especially analog. I have been
struggling
with this for some time but no luck. I want to set up analog on my freebsd
server and have it automatically produce a report every day which is stored
in a directory. How do I do this? What settings do I set and if I need to
set up a cron job, how do I do this?

Many thanks,

James


+------------------------------------------------------------------------
|  This is the analog-help mailing list. To unsubscribe from this
|  mailing list, go to
|    http://lists.isite.net/listgate/analog-help/unsubscribe.html
|
|  List archives are available at
|    http://www.mail-archive.com/[email protected]/
|    http://lists.isite.net/listgate/analog-help/archives/
|    http://www.tallylist.com/archives/index.cfm/mlist.7
+------------------------------------------------------------------------



+------------------------------------------------------------------------
|  This is the analog-help mailing list. To unsubscribe from this
|  mailing list, go to
|    http://lists.isite.net/listgate/analog-help/unsubscribe.html
|
|  List archives are available at
|    http://www.mail-archive.com/[email protected]/
|    http://lists.isite.net/listgate/analog-help/archives/
|    http://www.tallylist.com/archives/index.cfm/mlist.7
+------------------------------------------------------------------------

Reply via email to