syntax problem with cron

Alexander Dalloz alexander.dalloz at uni-bielefeld.de
Wed Sep 8 15:56:20 UTC 2004


Am Mi, den 08.09.2004 schrieb Mike Burger um 17:27:

> What workaround?  The "straight way", as you put it, would be to do it ina  
> script, so that, if you just want to modify what the cron job does, and 
> now when it does it, you just edit the script.  Putting multiple commands 
> in a crontab entry often just winds up with an unreadable crontab entry.

> Mike Burger

Though I find the crontab Steven wants to use a bit "strange", I mean
the way he wants to invoke freshclam by random, the single crontab line
is very short and obvious. So the direct way is to escape the "%" sign
and and not to go around. Same situation where you have a crontab entry
with a date test case (date +%A i.e.), I do not really see why putting
this in a single script file is better. Sure, long scriptings would make
a crontab less transparent.

1 * * * * sleep $[ $RANDOM \% 1800 ] ;/usr/bin/freshclam --quiet

I wouldn't use this crontab because it does not what it should do. It
starts every single minute a new task, wating the random amount of
seconds until it executes the freshclam process. So these "sleepers" are
rapidly growing.

To Steven: there is the freshclam service and the freshclam.conf, so
that you can configure it to run for instance every 2 hours (recommended
interval by ClamAV developers) to check for new signature files. Why do
you want to make the check random?

Alexander


-- 
Alexander Dalloz | Enger, Germany | GPG key 1024D/ED695653 1999-07-13
Fedora GNU/Linux Core 2 (Tettnang) kernel 2.6.8-1.521smp 
Serendipity 17:45:23 up 9 days, 15:02, load average: 0.20, 0.35, 0.62 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://lists.fedoraproject.org/pipermail/users/attachments/20040908/f1f32f34/attachment-0002.bin 


More information about the users mailing list