[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] crontab & exec problem.



Charles Teton wrote:

> This seems to work fine apart from where 'chkrootkit' need to 'exec' a file.
> I can run 'chkrootkit' properly if I login, just not via 'crontab'. Can
> anyone see where I'm going wrong...

This bit of code, dropped into /etc/cron.daily (I call the file simply
"chkrootkit" and set the rights to 700), seems to work fine:

<snip>
#!/bin/sh

# run chkrootkit daily after 6 am
sleep 7200
cd /root/installed/chkrootkit-0.35/
./chkrootkit > /root/chkrootkit.out
mail jlasman@xxxxxxxxxxxxx < /root/chkrootkit.out
</snip>

You of course sholdn't copy the lines with <...> on them; that's just to
show I've cut and pasted something into this post.

While I don't delete the file left in /root/chkrootkit.out (in case for
some reason I need to look at it later), you of course may; all you have
to do is append this last line to your file:

rm /root/chkrootkit.out

Jeff
-- 
Jeff Lasman <jblists@xxxxxxxxxxxxx>
Linux and Cobalt/Sun/RaQ Consulting
nobaloney.net, P. O. Box 52672, Riverside, CA  92517
voice: +1 909 778-9980  *  fax: +1 909 548-9484