Amigos tengo un grandisimo problema con SARG me esta haciendo los reportes manuales pero los automaticos que los tengo puestos con estos scripts
[quote='/etc/cron.daily/sarg']
# Eliminar reportes diarios con mas de 10 dias de antiguedad
echo "Rotacion diaria del dia `date +%d-%m-%Y`" >> /var/log/squid3/sarg-rotate.log
find /var/www/squid-reports/Diario -type d -mtime +10 -exec rm -rf {} \; >> /var/log/squid3/sarg-rotate.log 2>&1
rm -rf /var/www/squid-reports/Diario/index.html
# Ejeuctar sarg
#!/bin/bash
exec /usr/bin/sarg \
-o /var/www/squid-reports/Diario \
-d "$(date --date "1 day ago" +%d/%m/%Y)" > /dev/null 2>&1
exit 0
[/quote]
[quote='/etc/corn.weekly']
#!/bin/bash
LOG_FILES=
if [[ -s /var/log/squid3/access.log.1.gz ]]; then
LOG_FILES="$LOG_FILES -l /var/log/squid3/access.log.1.gz"
fi
if [[ -s /var/log/squid3/access.log ]]; then
LOG_FILES="$LOG_FILES -l /var/log/squid3/access.log"
fi
# Get yesterday's date
YESTERDAY=$(date --date "1 days ago" +%d/%m/%Y)
# Get one week ago date
WEEKAGO=$(date --date "7 days ago" +%d/%m/%Y)
# Eliminar reportes diarios con mas de 5 semanas (40 dias) de antiguedad
echo "Rotacion Semanal del dia `date +%d-%m-%Y`" >> /var/log/squid3/sarg-rotate.log
find /var/www/squid-reports/Semanal -type d -mtime +40 -exec rm -rf {} \; >> /var/log/squid3/sarg-rotate.log 2>&1
rm -rf /var/www/squid-reports/Semanal/index.html
# Ejecutar sarg
exec /usr/bin/sarg \
$LOG_FILES \
-o /var/www/squid-reports/Semanal \
-d $WEEKAGO-$YESTERDAY > /dev/null 2>&1
exit 0
[/quote]
[quote='/etc/cron.monthly/sarg']
#!/bin/bash
LOG_FILES=
if [[ -s /var/log/squid3/access.log.4.gz ]]; then
LOG_FILES="$LOG_FILES -l /var/log/squid3/access.log.4.gz"
fi
if [[ -s /var/log/squid3/access.log.3.gz ]]; then
LOG_FILES="$LOG_FILES -l /var/log/squid3/access.log.3.gz"
fi
if [[ -s /var/log/squid3/access.log.2.gz ]]; then
LOG_FILES="$LOG_FILES -l /var/log/squid3/access.log.2.gz"
fi
if [[ -s /var/log/squid3/access.log.1.gz ]]; then
LOG_FILES="$LOG_FILES -l /var/log/squid3/access.log.1.gz"
fi
if [[ -s /var/log/squid3/access.log ]]; then
LOG_FILES="$LOG_FILES -l /var/log/squid3/access.log"
fi
# Get yesterday's date
YESTERDAY=$(date --date "1 day ago" +%d/%m/%Y)
# Get 1 month ago date
MONTHAGO=$(date --date "1 month ago" +%d/%m/%Y)
# Eliminar reportes diarios con mas de 6 meses (180 dias) de antiguedad
echo "Rotacion mensual del dia `date +%d-%m-%Y`" >> /var/log/squid3/sarg-rotate.log
find /var/www/squid-reports/Mensual -type d -mtime +180 -exec rm -rf {} \; >> /var/log/squid3/sarg-rotate.log 2>&1
rm -rf /var/www/squid-reports/Mensual/index.html
# Ejecutar sarg
exec /usr/bin/sarg \
$LOG_FILES \
-o /var/www/squid-reports/Mensual \
-d $MONTHAGO-$YESTERDAY > /dev/null 2>&1
exit 0
[/quote]
Alguna idea de que pueda estar mal??
Sarg no me hace los reportes
- fVckingmania.hell
- Mensajes: 549
- Registrado: Sab, 07 Ago 2010, 14:09
- Ubicación: /usr/src/yo.tar.bz2