[TriLUG] Re: tailing forever

James Manning trilug at sublogic.com
Thu Mar 28 23:44:54 EST 2002


[M. Mueller at Signalnetware.com]
> In my RH system, in /etc/cron.daily/logrotate I have the following lines:
> 
> # rotate the files 
> logrotate /etc/logrotate.conf
> # stop/start syslogd and klogd; this also kills the current PID of syslogd
> # which makes the next command work 
> /etc/rc.d/init.d/syslog restart
> # tail, follow, until pid of syslogd dies
> tail -f --pid=$(cat /var/run/syslogd.pid) /var/log/messages
> 
> If anybody sees something screwy here, please call it out.

I don't quite see how the tail in a cron job does anything except make a
cron job that'll 1) make a *very* long email and 2) run for a long time
(basically a week when the next one runs - if cron even handles that)

my initial suggestion pointing out --pid was to do it in a while true;
bash loop from some terminal window or screen window or virtual console or
wherever it is you wanted the output - doing the tail inside a cron job,
at least at the moment, doesn't seem to really serve a purpose AFAICT.
-- 
James Manning <jmm at sublogic.com>
GPG Key fingerprint = B913 2FBD 14A9 CE18 B2B7  9C8E A0BF B026 EEBB F6E4



More information about the TriLUG mailing list