<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=utf-8" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18904">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2 face=Arial>Bom Dia,</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>eu utilizo a seguinte solução:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>eu crio 3 arquivo sarg.conf </FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>um diario, um semana e um mensal, </FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>cada um com lugar expecifico a saida:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>diario: output_dir 
/var/www/html/squid-reports/diario</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>semana: output_dir 
/var/www/html/squid-reports/semana</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>mes: output_dir 
/var/www/html/squid-reports/mes</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>e cria 3 scrips, diario, semana, 
mensal</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>segue eles</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>diario:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>#!/bin/bash</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>HOJE=$(date --date "1 day ago" 
+%d/%m/%Y)<BR>/usr/local/bin/sarg -f /usr/local/etc/sarg.conf -d 
$HOJE-$HOJE<BR>exit 0<BR></FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>Semana:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>#!/bin/bash<BR>LOG_FILES=<BR>if [ -s 
/var/log/squid/access.log.1.gz ]; 
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOG_FILES="$LOG_FILES -l 
/var/log/squid/access.log.1.gz"<BR>fi<BR>if [ -s /var/log/squid/access.log ]; 
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOG_FILES="$LOG_FILES -l 
/var/log/squid/access.log"<BR>fi</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial># Get yesterday's date<BR>YESTERDAY=$(date --date 
"1 days ago" +%d/%m/%Y)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial># Get one week ago date<BR>WEEKAGO=$(date --date "7 
days ago" +%d/%m/%Y)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>exec /usr/local/bin/sarg 
\<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $LOG_FILES 
\<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -o 
/var/www/html/squid-reports/semana/ 
\<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -f 
/usr/local/etc/sarg-semana.conf \<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
-d $WEEKAGO-$YESTERDAY &amp;&gt;/dev/null<BR>exit 0<BR></FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>&nbsp;</DIV></FONT>
<DIV><FONT size=2 face=Arial>Mes:</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>#!/bin/bash<BR>LOG_FILES=<BR>if [ -s 
/var/log/squid/access.log.4.gz ]; 
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOG_FILES="$LOG_FILES -l 
/var/log/squid/access.log.4.gz"<BR>fi<BR>if [ -s /var/log/squid/access.log.3.gz 
]; then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOG_FILES="$LOG_FILES -l 
/var/log/squid/access.log.3.gz"<BR>fi<BR>if [ -s /var/log/squid/access.log.2.gz 
]; then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOG_FILES="$LOG_FILES -l 
/var/log/squid/access.log.2.gz"<BR>fi<BR>if [ -s /var/log/squid/access.log.1.gz 
]; then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOG_FILES="$LOG_FILES -l 
/var/log/squid/access.log.1.gz"<BR>fi<BR>if [ -s /var/log/squid/access.log ]; 
then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LOG_FILES="$LOG_FILES -l 
/var/log/squid/access.log"<BR>fi</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial># Get yesterday's date<BR>YESTERDAY=$(date --date 
"1 day ago" +%d/%m/%Y)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial># Get 1 month ago date<BR>MONTHAGO=$(date --date "1 
month ago" +%d/%m/%Y)</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>exec /usr/local/bin/sarg 
\<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $LOG_FILES 
\<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -o /var/www/squid-reports/mes 
\<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -f 
/usr/local/etc/sarg-mensal.conf \<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
-d $MONTHAGO-$YESTERDAY &amp;&gt;/dev/null<BR>exit 0</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>Ai coloco no Crontab, e tudo funciona numa 
boa</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>#Relatorio Sarg<BR>01 1 * * * root 
/usr/local/etc/./sarg-dia<BR>30 3 * * 0 root /usr/local/etc/./sarg-semana<BR>30 
4 1 * * root /usr/local/etc/./sarg-mensal<BR></FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>&nbsp;</DIV></FONT>
<DIV><FONT size=2 face=Arial></FONT>&nbsp;</DIV>
<DIV><FONT size=2 face=Arial>Att,</FONT></DIV>
<DIV><FONT size=2 face=Arial>Paulo</FONT></DIV>
<BLOCKQUOTE 
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B> 
  <A title=irado@bsd.com.br href="mailto:irado@bsd.com.br">irado furioso com 
  tudo</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=centos-pt-br@centos.org 
  href="mailto:centos-pt-br@centos.org">lista CentOS-br</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, May 03, 2011 9:40 AM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> [CentOS-pt-br] [off] sarg - 
  relatorios separados por Ã©poca</DIV>
  <DIV><BR></DIV>buenas, gente.<BR><BR>por favor, já procurei mas não encontrei 
  alguma ajuda seja no google, seja nos foruns; preciso que os relatórios do 
  sarg sejam separados por Ã©poca de sua execução, por 
  exemplo:<BR><BR>/var/www/squid-reports/ (até aqui, convencional, porém, ABAIXO 
  DÊSTE FOLDER):<BR><BR>diario<BR>semanal<BR>mensal<BR><BR>onde deverão ser 
  gerados os respectivos relatorios. Sei que Ã© lá no sarg.conf porém não 
  encontrei exemplos :\<BR><BR>alguma dica, url ??<BR><BR>grato,<BR><BR 
  clear=all><BR>-- <BR><BR>saudações,<BR>irado furioso com tudo<BR>mais crimes 
  são cometidos em nome das religiões do que em nome do 
  ateismo.<BR><BR><BR><BR>-- <BR>Esta mensagem foi verificada pelo sistema de 
  antiv�rus e <BR>acredita-se estar livre de perigo. 
  <P>
  <HR>

  <P></P>_______________________________________________<BR>CentOS-pt-br mailing 
  list<BR>CentOS-pt-br@centos.org<BR>http://lists.centos.org/mailman/listinfo/centos-pt-br<BR></BLOCKQUOTE><br />--
<br />Esta mensagem foi verificada pelo sistema de antivírus e 
<br /> acredita-se estar livre de perigo.
</BODY></HTML>