Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jun 2015 07:48:26 +0100
From:      krad <kraduk@gmail.com>
To:        kpneal@pobox.com
Cc:        Polytropon <freebsd@edvax.de>, "Lt. Commander" <listmgr@antennex.com>,  FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: Script question
Message-ID:  <CALfReyfnantyKn7v6V3P%2B0tPh7JN6LTbVCt9%2BaajF1cAn1o=SA@mail.gmail.com>
In-Reply-To: <20150615165110.GB23194@neutralgood.org>
References:  <BAY182-W89C2924F4BDF0D2BD3810DF4BB0@phx.gbl> <CA%2Bg%2BBvjNv0PBOfmnWkzE26Tgqj6qZ-VKbHXMpuB8gak69G_T2g@mail.gmail.com> <BAY404-EAS263BBC0728E6171BD47A4AECCBA0@phx.gbl> <557B8484.9060405@gmail.com> <BAY182-W64842DB24FDD6D0F3A1854CCBA0@phx.gbl> <557C6DED.9070105@gmail.com> <BAY404-EAS148D4B304BB066F07E84004CCB90@phx.gbl> <20150615015516.b3ea7633.freebsd@edvax.de> <20150615165110.GB23194@neutralgood.org>

next in thread | previous in thread | raw e-mail | index | archive | help
dont do it willy nilly though as if you fill /tmp it can cause a system
issues, especially for tmpfs backed systems, and always clean up after
yourself

On 15 June 2015 at 17:51, <kpneal@pobox.com> wrote:

> On Mon, Jun 15, 2015 at 01:55:16AM +0200, Polytropon wrote:
> > On Sun, 14 Jun 2015 15:07:18 -0500, Lt. Commander wrote:
> > > I know it's ugly..... but places a list of the IPs in a file plus
> sends me a
> > > message with the same list.
> >
> > Yes, it is ugly, but will probably work fine. :-)
> >
> > Allow me a few comments:
> >
> > > #!/bin/sh
> > > cd /var/log
> >
> > Use absolute file names - you're accessing /var/log/maillog
> > only once.
>
> Seconded.
>
> > > grep -i spam=YES maillog > spam.tmp && \
> >
> > Don't write temporary files to /var/log, use /tmp instead.
>
> Major, major seconded. On top of that, use the mktemp command in scripts.
>
> --
> Kevin P. Neal                                http://www.pobox.com/~kpn/
> "Not even the dumbest terrorist would choose an encryption program that
>  allowed the U.S. government to hold the key." -- (Fortune magazine
>     is smarter than the US government, Oct 29 2001, page 196.)
> _______________________________________________
> freebsd-questions@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "
> freebsd-questions-unsubscribe@freebsd.org"
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CALfReyfnantyKn7v6V3P%2B0tPh7JN6LTbVCt9%2BaajF1cAn1o=SA>