On Monday 18 August 2003 16:43, lonely wolf wrote:
> Serghei Amelian wrote:
> >On Monday 18 August 2003 16:31, Serghei Amelian wrote:
> >>On Monday 18 August 2003 16:28, Calin Damian wrote:
> >>>On Monday 18 August 2003 16:24, you wrote:
> >>>>Cum pot sa adun doua numere in sh (sau bash)?
> >>>
> >>>man bc
> >>>(optiune utila -> scale daca ai zecimale)
> >>
> >>No, pur si simplu rotesc un log si trebuie sa aflu care e urmatorul numar
> >>de log.
> >
> >Asta e scriptul de rotit loage, poate mai intereseaza pe cineva:
> >
> >#!/bin/sh
> >
> >if test `ls -l logging | awk {'print $5'}` -gt 5000000 ; then
> > NO=`ls logging.* 2>/dev/null | awk -F . {'print $2 + 1'}`
> > if test -z $NO ; then
> > NO=1
> > fi
> > mv logging logging.$NO
> > gzip logging.$NO
> > touch logging
> >fi
> >
> >
> >Bineinteles ca daemonul care produce log-ul trebuie oprit inainte de face
> >rotirea.
>
> nu ca nu as fi circotas, dar ce e nou fata de logrotate ?
> Description :
> The logrotate utility is designed to simplify the administration of
> log files on a system which generates a lot of log files. Logrotate
> allows for the automatic rotation compression, removal, and mailing of
> log files. Logrotate can be set to handle a log file daily, weekly,
> monthly, or when the log file gets to a certain size. Normally,
> logrotate runs as a daily cron job.
Nu are absolut nimic nou, doar ca eu opresc daemonul inainte de move si il
pornesc imediat dupa, nu pierd de exemplu timp cand se face compresia. Iar
daca logfile-ul nu are mai mult de 5M nici nu opresc daemonul.
--
Serghei.
---
Detalii despre listele noastre de mail: http://www.lug.ro/