From owner-freebsd-questions@FreeBSD.ORG Sat Jan 16 17:12:18 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1616B1065670 for ; Sat, 16 Jan 2010 17:12:18 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (gate6.infracaninophile.co.uk [IPv6:2001:8b0:151:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 6A23C8FC0C for ; Sat, 16 Jan 2010 17:12:17 +0000 (UTC) Received: from happy-idiot-talk.infracaninophile.co.uk (localhost [IPv6:::1]) (authenticated bits=0) by smtp.infracaninophile.co.uk (8.14.4/8.14.3) with ESMTP id o0GHBsEF071813; Sat, 16 Jan 2010 17:12:00 GMT (envelope-from m.seaman@infracaninophile.co.uk) X-DKIM: Sendmail DKIM Filter v2.8.3 smtp.infracaninophile.co.uk o0GHBsEF071813 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=infracaninophile.co.uk; s=201001-infracaninophile; t=1263661920; bh=eCAQZhW+RHy6yne8+tHDrjtYWN1bfkp52pMvtRM9FUo=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Cc:Content-Type:Date:From:In-Reply-To: Message-ID:Mime-Version:References:To; z=Message-ID:=20<4B51F354.1090608@infracaninophile.co.uk>|Date:=20S at,=2016=20Jan=202010=2017:11:48=20+0000|From:=20Matthew=20Seaman= 20|Organization:=20Infracaninophi le|User-Agent:=20Thunderbird=202.0.0.23=20(X11/20100114)|MIME-Vers ion:=201.0|To:=20Anton=20Shterenlikht=20|CC:= 20freebsd-questions@freebsd.org|Subject:=20Re:=20getting=20firewal l=20logs=20via=20/etc/periodic/daily=20?|References:=20<2010011616 5331.GK91835@mech-cluster241.men.bris.ac.uk>|In-Reply-To:=20<20100 116165331.GK91835@mech-cluster241.men.bris.ac.uk>|X-Enigmail-Versi on:=200.95.6|Content-Type:=20multipart/signed=3B=20micalg=3Dpgp-sh a256=3B=0D=0A=20protocol=3D"application/pgp-signature"=3B=0D=0A=20 boundary=3D"------------enig26A2E700352C9F5F02098BEF"; b=BTSHmwDevXhWQYpxaLlH6GG0HsNoqrLCfX4inADh3rA3RuqvzIg2OTXO2Ia5O6xjN O1vGMIqJ3i0nckdWSdY6HlwD0jm5KiifphVBJdickhs0SviZ9tEUzgip1n3vhazJE6 Q0bBZzMfwxVR3z1MgHsjbkVlUMVP+XwzsNYxxzHY= X-Authentication-Warning: happy-idiot-talk.infracaninophile.co.uk: Host localhost [IPv6:::1] claimed to be happy-idiot-talk.infracaninophile.co.uk Message-ID: <4B51F354.1090608@infracaninophile.co.uk> Date: Sat, 16 Jan 2010 17:11:48 +0000 From: Matthew Seaman Organization: Infracaninophile User-Agent: Thunderbird 2.0.0.23 (X11/20100114) MIME-Version: 1.0 To: Anton Shterenlikht References: <20100116165331.GK91835@mech-cluster241.men.bris.ac.uk> In-Reply-To: <20100116165331.GK91835@mech-cluster241.men.bris.ac.uk> X-Enigmail-Version: 0.95.6 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig26A2E700352C9F5F02098BEF" X-Virus-Scanned: clamav-milter 0.95.3 at happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VERIFIED,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on happy-idiot-talk.infracaninophile.co.uk Cc: freebsd-questions@freebsd.org Subject: Re: getting firewall logs via /etc/periodic/daily ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jan 2010 17:12:18 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig26A2E700352C9F5F02098BEF Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Anton Shterenlikht wrote: > I'd like to receive the firewall logs together > with the usual /etc/periodic/daily email. > What's the easiest/safest way to achieve this? >=20 > Shall I add my own script under /etc/periodic/daily? > Shall I modify an existing script, e.g. 310.accounting? Sure -- you can add your own scripts to the periodic jobs. For things th= at aren't part of the base system, the usual place is=20 /usr/local/etc/periodic/{daily,weekly,monthly,security} If you decide to adapt one of the system scripts to do what you want, it'= s best to copy it to /usr/local/periodic/whatever/ and change the prefix of= the configuration variables inside it. When writing a periodic script, you generally want the following boilerplate at the top of the file: # If there is a global system configuration file, suck it in. # if [ -r /etc/defaults/periodic.conf ] then . /etc/defaults/periodic.conf source_periodic_confs fi plus you should take care to set the return code of the script carefully:= 0 means 'everything OK', 1 means 'you might want to look at this output',= 2 means 'oops, you configured the script wrong' and >2 means 'it's all go= ne a bit pear shaped'. periodic(8) has more detail. Cheers, Matthew=20 --=20 Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW --------------enig26A2E700352C9F5F02098BEF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEAREIAAYFAktR81kACgkQ8Mjk52CukIwoWwCeKG5ZZG8+mQxONV2WpAw3z5nM tNEAoI4Kh0txZYZuYHgHCEfEwTvKCJCN =cSYI -----END PGP SIGNATURE----- --------------enig26A2E700352C9F5F02098BEF--