- # Verifico que el logfile no se pase del tamaƱo maximo
- tam=`stat -c '%s' $LOGFILE`
- # Si se paso del maximo dejo las ultimas 100 lineas
- if [ "$tam" -ge "$AFIM_LOGSIZE" ]; then
- echo tail -n 100 $LOGFILE \> "$LOGDIR/$0.$$.temp"
- echo mv "$LOGDIR/$0.$$.temp" $LOGFILE
- tail -n 100 $LOGFILE > "$LOGDIR/$0.$$.temp"
- mv "$LOGDIR/$0.$$.temp" $LOGFILE
- fi