getting firewall logs via /etc/periodic/daily ?

Matthew Seaman m.seaman at infracaninophile.co.uk
Sat Jan 16 17:12:18 UTC 2010


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?
> 
> 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 that
aren't part of the base system, the usual place is 
/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 gone
a bit pear shaped'.  periodic(8) has more detail.

	Cheers,

	Matthew 

-- 
Dr Matthew J Seaman MA, D.Phil.                   7 Priory Courtyard
                                                  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey     Ramsgate
                                                  Kent, CT11 9PW

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 259 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20100116/6d736013/signature.pgp


More information about the freebsd-questions mailing list