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

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to