Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Apr 2010 10:32:06 -0700
From:      merlyn@stonehenge.com (Randal L. Schwartz)
To:        Jos Chrispijn <kernel@webrz.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Auto update
Message-ID:  <86aat9uc89.fsf@red.stonehenge.com>
In-Reply-To: <4BC1972B.1080603@webrz.net> (Jos Chrispijn's message of "Sun, 11 Apr 2010 11:32:27 %2B0200")
References:  <4BC168D8.7080900@webrz.net> <F02E5989-F279-4059-9858-EF36FDA726FC@lafn.org> <4BC1972B.1080603@webrz.net>

next in thread | previous in thread | raw e-mail | index | archive | help
>>>>> "Jos" == Jos Chrispijn <kernel@webrz.net> writes:

Jos> In order to find out if someone logged in, I should then first copy auth.log
Jos> to auth2.log, and do a compare and then do the tail trick. Have to cron that
Jos> every half a minute.

No, just track it with tail -f as was already suggested.

tail -f /var/log/authlog | while read aline; do; ... ; done

The code in the middle will get executed as each line appears in the
file.  This even survives authlog renaming when you logroll.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>;
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86aat9uc89.fsf>