🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #1688

Re: Script tcpdump

#1688
From: Kunael
Date: Sun, 21 Aug 2005 10:40
27 lines
1828 bytes
> Yo haría algo así:
> 
> FECHA=$(date +%m-%d-%Y)
> CONTADOR=0
> LOG=/var/log/tcpdump/tcpdump-$FECHA-$CONTADOR.log
> 
> while [ -e $LOG ]; do
>         let CONTADOR=CONTADOR+1
> LOG=/var/log/tcpdump/tcpdump-$FECHA-$CONTADOR.log
> done
> 
> tcpdump -i eth0 -q -w $LOG

Pero de esta manera tendrás sólo el log0. Es verdad que después tendrás el
log1, pero a la tercera ejecución del script, no tendrás el log2, sino un
log1 machacado.
 
> y para ordenar cronológicamente los ficheros es mejor usar el formato
> de fecha YYYY-MM-DD, o sea $(date +%F)

Si, deberé tenderlo en cuenta.

-- 
¡Share your knowledge!

Linux user id 332494  # http://counter.li.org/
PGP id 0xC5ABA76A  # http://pgp.mit.edu/
Technical Details
Message-ID: <de9lo3$krg$2@antonio.escomposlinux.org>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!newsfeed.news2me.com!peer01.west.cox.net!cox.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!antonio.escomposlinux.org!escomposlinux.org!not-for-mail
References: <de6o9k$pob$1@antonio.escomposlinux.org> <20050820124849.2cc399d8@petres.salonet.snet>

Show Full Headers
Complete Article Headers
X-Google-Thread: f86c8,261b71624a54c2c5
X-Google-Attributes: gidf86c8,public
X-Google-Language: SPANISH,UTF8
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!newshub.sdsu.edu!newsfeed.news2me.com!peer01.west.cox.net!cox.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!antonio.escomposlinux.org!escomposlinux.org!not-for-mail
From: Kunael <kunael4@yahoo.es>
Newsgroups: es.comp.os.linux.programacion
Subject: Re: Script tcpdump
Date: Sun, 21 Aug 2005 12:40:48 +0200
Organization: Servidor de noticias de la red Ecolnet
Lines: 27
Message-ID: <de9lo3$krg$2@antonio.escomposlinux.org>
References: <de6o9k$pob$1@antonio.escomposlinux.org> <20050820124849.2cc399d8@petres.salonet.snet>
Reply-To: kunael4@yahoo.es
NNTP-Posting-Host: 3.red-217-126-41.pooles.rima-tde.net
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8Bit
X-Trace: antonio.escomposlinux.org 1124620869 21360 217.126.41.3 (21 Aug 2005 10:41:09 GMT)
X-Complaints-To: newsmaster@antonio.escomposlinux.org
NNTP-Posting-Date: Sun, 21 Aug 2005 10:41:09 +0000 (UTC)
User-Agent: KNode/0.9.0