From owner-freebsd-questions@FreeBSD.ORG Thu Nov 17 08:21:30 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id ECAFF16A420 for ; Thu, 17 Nov 2005 08:21:29 +0000 (GMT) (envelope-from i.tanusheff@procreditbank.bg) Received: from mail.procreditbank.bg (mail.procreditbank.bg [212.95.179.198]) by mx1.FreeBSD.org (Postfix) with SMTP id 7D5C443D55 for ; Thu, 17 Nov 2005 08:21:25 +0000 (GMT) (envelope-from i.tanusheff@procreditbank.bg) Received: (qmail 72845 invoked from network); 17 Nov 2005 10:21:22 +0200 Received: from unknown (HELO localhost) (127.0.0.1) by localhost with SMTP; 17 Nov 2005 10:21:22 +0200 Received: from proxy.procreditbank.bg ([127.0.0.1]) by localhost (mail.procreditbank.bg [127.0.0.1]) (amavisd-new, port 10024) with SMTP id 27197-567 for ; Thu, 17 Nov 2005 10:21:21 +0200 (EET) Received: (qmail 72816 invoked from network); 17 Nov 2005 08:21:20 -0000 Received: from unknown (HELO outmail.procreditbank.bg) (172.16.248.123) by mail.procreditbank.bg with SMTP; 17 Nov 2005 08:21:20 -0000 In-Reply-To: <437BCDC2.2010102@makeworld.com> To: RacerX@makeworld.com MIME-Version: 1.0 X-Mailer: Lotus Notes Release 6.5.1 January 21, 2004 From: Ivailo Tanusheff Message-ID: Date: Thu, 17 Nov 2005 10:21:22 +0200 X-MIMETrack: Serialize by Router on DOMINO_HQ/PROCREDITBANK(Release 6.5.1|January 21, 2004) at 11/17/2005 10:21:21 AM, Serialize complete at 11/17/2005 10:21:21 AM X-Virus-Scanned: by amavisd-new using ClamAV at procreditbank.bg Content-Type: text/plain; charset="US-ASCII" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: FreeBSD - Questions , FreeBSD - Ports Subject: Re: Sarg scripts X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Nov 2005 08:21:30 -0000 Maybe mine is not perfect, but this is what I use at work :) I use several conf files, like sarg_proxy_daily.conf. The only difference between those files is where to put output files, as I use different filders for different type or reports, i.e. I have dayly, weekly, monthly and yearly folder :) You can use only one config to store all data in the same place or use proper command option. Hope this will help you: root@logserver# cat /usr/local/etc/reports/proxy_squid.sh #!/bin/sh -x ###################### # # # Config # # # ##################### LOGDIR=/data/proxy/logs TODAY=$(date +%d/%m/%Y) YESTERDAY=$(date -v-1d +%d/%m/%Y) WEEKAGO=$(date -v-1w -v-1d +%d/%m/%Y) MONTHAGO=$(date -v-1m -v-1d +%d/%m/%Y) YEARAGO=$(date -v-1y -v-1d +%d/%m/%Y) ###################### # # # Script # # # ##################### if [ $# -ne 1 ]; then /bin/echo "Usage: `basename $0` [d|w|m|y]" exit 0 fi case "$1" in d) /usr/local/bin/sarg -f /usr/local/etc/sarg/sarg_proxy_daily.conf -d $YESTERDAY-$YESTERDAY -x ;; w) /usr/local/bin/sarg -f /usr/local/etc/sarg/sarg_proxy_weekly.conf -d $WEEKAGO-$YESTERDAY ;; m) /usr/local/bin/sarg -f /usr/local/etc/sarg/sarg_proxy_monthly.conf -d $MONTHAGO-$YESTERDAY ;; y) /usr/local/bin/sarg -f /usr/local/etc/sarg/sarg_proxy_yearly.conf -d $YEARAGO-$YESTERDAY ;; *) /bin/echo "Usage: `basename $0` [d|w|m|y]" ;; esac Ivailo Tanusheff Senior System administrator ProCredit Bank (Bulgaria) AD http://www.procreditbank.bg Chris Sent by: owner-freebsd-questions@freebsd.org 11/17/2005 02:24 AM Please respond to RacerX@makeworld.com To FreeBSD - Questions , FreeBSD - Ports cc Subject Sarg scripts If anyone is using sarg (/usr/ports/www/sarg) I would really appreciate what you are doing for gathering daily/weekly/monthly info. This would be in the form of scripts I assume and cron. -- Best regards, Chris You can observe a lot just by watching. _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"