RE: [Clamav-users] freshclam: crontab vs. daemon

2004-09-11 Thread Peter Kiem
Hi,
 
> > > 0 * * * * sleep $[ $RANDOM % 1800 ] ; /usr/local/bin/freshclam --quiet

I just spent AGES trying to get this to work on some Linux systems.  Turns
out that unless you escape the % on those systems the crontab entry will
fail.

This is what is working for me on my Fedora Core 2 systems:

12 * * * * sleep `expr $RANDOM \% 1800` && /usr/bin/freshclam --quiet

Regards,
+-+-+
| Peter Kiem    .^.   | E-Mail    : <[EMAIL PROTECTED]> |
| Zordah IT /V\   | Mobile    : +61 0414 724 766    |
|   IT Consultancy &  /(   )\ | WWW   : www.zordah.net  |
|   Internet Services  ^^-^^  | ICQ   : "Zordah" 81 |
+-+-+



---
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
___
Clamav-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/clamav-users


Re: [Clamav-users] freshclam: crontab vs. daemon

2004-09-07 Thread Mister Coffee
On Tue, Sep 07, 2004 at 07:35:26AM -0700, Bill Randle wrote:

> > >  
> > > 0 * * * * sleep $[ $RANDOM % 1800 ] ; /usr/local/bin/freshclam --quiet
> > >
> > > this causes it to sleep for a random period of time not exceeding
> > > 30 min before executing.  
> > >
> > > Rob
> > 
> > 
> > Matt
> 
> Slightly better, I think, is to add an offset to avoid hitting close to
> the hour. This is what I use:
>   sleep $[ 900 + $RANDOM % 1800 ]
> 
> which goes from 15 past to 15 to the hour.
> 
>   -Bill
> 
Or simply place your offset into the crontab entry.  EG:

12 * * * * sleep $[ $RANDOM % 1800 ] ; /usr/local/bin/freshclam --quiet

Which would give you 12 to 42 minutes after the hour.

Same effect.  Different insertion point.

UNIX: How many ways can we acomplish the same thing today?
Choice is good.

Cheers,
L4J



---
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
___
Clamav-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/clamav-users


Re: [Clamav-users] freshclam: crontab vs. daemon

2004-09-07 Thread Bill Randle
On Tue, 2004-09-07 at 04:19, Matt wrote:
> Ralph Angenendt wrote:
> 
> > Niek wrote:
> > > On 9/7/2004 9:28 AM +0200, Ralph Angenendt wrote:
> > > 
> > > >Which would give the following behaviour how?
> > > >
> > > >| ClamAV update process started at Tue Sep  7 07:08:22 2004
> > > >| ClamAV update process started at Tue Sep  7 08:01:43 2004
> > > >| ClamAV update process started at Tue Sep  7 08:55:03 2004
> > > >
> > > 
> > > something like the following in freshclam.conf:
> > > Checks 25 or 26
> > 
> > As you can see, I'm fully aware of that. "How do you do that with
> > crontab" was the question longing for an answer.
> > 
> > Ralph
> 
> 
>  There was a crontab entry posted a while since, which made use of
> $[RANDOM] to alter the update time. 
>  
>  Relevant section from the original email:
> 
> > As per discussions on this list on awhile ago; I use the following for
> > my crontab entry:
> >  
> > 0 * * * * sleep $[ $RANDOM % 1800 ] ; /usr/local/bin/freshclam --quiet
> >
> > this causes it to sleep for a random period of time not exceeding
> > 30 min before executing.  
> >
> > Rob
> 
> 
> Matt

Slightly better, I think, is to add an offset to avoid hitting close to
the hour. This is what I use:
sleep $[ 900 + $RANDOM % 1800 ]

which goes from 15 past to 15 to the hour.

-Bill




---
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
___
Clamav-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/clamav-users


Re: [Clamav-users] freshclam: crontab vs. daemon

2004-09-07 Thread Matt
Ralph Angenendt wrote:

> Niek wrote:
> > On 9/7/2004 9:28 AM +0200, Ralph Angenendt wrote:
> > 
> > >Which would give the following behaviour how?
> > >
> > >| ClamAV update process started at Tue Sep  7 07:08:22 2004
> > >| ClamAV update process started at Tue Sep  7 08:01:43 2004
> > >| ClamAV update process started at Tue Sep  7 08:55:03 2004
> > >
> > 
> > something like the following in freshclam.conf:
> > Checks 25 or 26
> 
> As you can see, I'm fully aware of that. "How do you do that with
> crontab" was the question longing for an answer.
> 
> Ralph


 There was a crontab entry posted a while since, which made use of
$[RANDOM] to alter the update time. 
 
 Relevant section from the original email:

> As per discussions on this list on awhile ago; I use the following for
> my crontab entry:
>  
> 0 * * * * sleep $[ $RANDOM % 1800 ] ; /usr/local/bin/freshclam --quiet
>
> this causes it to sleep for a random period of time not exceeding
> 30 min before executing.  
>
> Rob


Matt



---
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
___
Clamav-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/clamav-users


Re: [Clamav-users] freshclam: crontab vs. daemon

2004-09-07 Thread Ralph Angenendt
Niek wrote:
> On 9/7/2004 9:28 AM +0200, Ralph Angenendt wrote:
> 
> >Which would give the following behaviour how?
> >
> >| ClamAV update process started at Tue Sep  7 07:08:22 2004
> >| ClamAV update process started at Tue Sep  7 08:01:43 2004
> >| ClamAV update process started at Tue Sep  7 08:55:03 2004
> >
> 
> something like the following in freshclam.conf:
> Checks 25 or 26

As you can see, I'm fully aware of that. "How do you do that with
crontab" was the question longing for an answer.

Ralph
-- 
Ralph [EMAIL PROTECTED] | .."Text processing has made it possible
Bayerischer Rundfunk...HA-Multimedia | to right-justify any idea, even one
Rundfunkplatz 180300 MÃnchen | .which cannot be justified on any other
Tl:089.5900.16023..Fx:089.5900.16240 | ..grounds." -- J. Finnegan, USC


pgpPd5EDJqDZr.pgp
Description: PGP signature


Re: [Clamav-users] freshclam: crontab vs. daemon

2004-09-07 Thread Niek
On 9/7/2004 9:28 AM +0200, Ralph Angenendt wrote:
Which would give the following behaviour how?
| ClamAV update process started at Tue Sep  7 00:01:35 2004
| ClamAV update process started at Tue Sep  7 00:54:56 2004
| ClamAV update process started at Tue Sep  7 01:48:16 2004
| ClamAV update process started at Tue Sep  7 02:41:37 2004
| ClamAV update process started at Tue Sep  7 03:34:58 2004
| ClamAV update process started at Tue Sep  7 04:28:19 2004
| ClamAV update process started at Tue Sep  7 05:21:40 2004
| ClamAV update process started at Tue Sep  7 06:15:01 2004
| ClamAV update process started at Tue Sep  7 07:08:22 2004
| ClamAV update process started at Tue Sep  7 08:01:43 2004
| ClamAV update process started at Tue Sep  7 08:55:03 2004
Ralph
something like the following in freshclam.conf:
Checks 25 or 26
Kind regards,
Niek Baakman
--
___
Read about mime:http://www.geoapps.com/nomime.shtml
Read about quoting: http://www.netmeister.org/news/learn2quote.html
Read about disclaimers: http://www.goldmark.org/jeff/stupid-disclaimers
---
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
___
Clamav-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/clamav-users


Re: [Clamav-users] freshclam: crontab vs. daemon

2004-09-07 Thread Ralph Angenendt
Jeff Smelser wrote:
> On Monday 06 September 2004 01:25 pm, Thomas Lamy wrote:
> > It's a matter of taste. I prefer running it in daemon mode, as freshclam
> > is rock solid (eg. it hasn't crashed here for months), and due to it's
> > random start time does not tend to overload the mirrors.
> > You have to use bashisms or perl (or some really crude sh pipe) to make
> > sure freshclam's cron job does not start exactly on the hour.
> 
> Why wouldnt you use this minute section?

Which would give the following behaviour how?

| ClamAV update process started at Tue Sep  7 00:01:35 2004
| ClamAV update process started at Tue Sep  7 00:54:56 2004
| ClamAV update process started at Tue Sep  7 01:48:16 2004
| ClamAV update process started at Tue Sep  7 02:41:37 2004
| ClamAV update process started at Tue Sep  7 03:34:58 2004
| ClamAV update process started at Tue Sep  7 04:28:19 2004
| ClamAV update process started at Tue Sep  7 05:21:40 2004
| ClamAV update process started at Tue Sep  7 06:15:01 2004
| ClamAV update process started at Tue Sep  7 07:08:22 2004
| ClamAV update process started at Tue Sep  7 08:01:43 2004
| ClamAV update process started at Tue Sep  7 08:55:03 2004

Ralph
-- 
Ralph [EMAIL PROTECTED] | .."Text processing has made it possible
Bayerischer Rundfunk...HA-Multimedia | to right-justify any idea, even one
Rundfunkplatz 180300 MÃnchen | .which cannot be justified on any other
Tl:089.5900.16023..Fx:089.5900.16240 | ..grounds." -- J. Finnegan, USC


pgpPEdErhP0gt.pgp
Description: PGP signature


Re: [Clamav-users] freshclam: crontab vs. daemon

2004-09-06 Thread Stephen Gran
On Mon, Sep 06, 2004 at 02:16:48PM -0500, Jeff Smelser said:
> On Monday 06 September 2004 01:25 pm, Thomas Lamy wrote:
> > It's a matter of taste. I prefer running it in daemon mode, as freshclam
> > is rock solid (eg. it hasn't crashed here for months), and due to it's
> > random start time does not tend to overload the mirrors.
> > You have to use bashisms or perl (or some really crude sh pipe) to make
> > sure freshclam's cron job does not start exactly on the hour.
> 
> Why wouldnt you use this minute section?

So that you get a random minute, rather than the same minute after the
hour every time.
-- 
 --
|  Stephen Gran  | A national debt, if it is not   |
|  [EMAIL PROTECTED] | excessive, will be to us a national |
|  http://www.lobefin.net/~steve | blessing.   -- Alexander Hamilton   |
 --


pgpA8vwcmnx2Q.pgp
Description: PGP signature


Re: [Clamav-users] freshclam: crontab vs. daemon

2004-09-06 Thread Jeff Smelser
On Monday 06 September 2004 01:25 pm, Thomas Lamy wrote:
> It's a matter of taste. I prefer running it in daemon mode, as freshclam
> is rock solid (eg. it hasn't crashed here for months), and due to it's
> random start time does not tend to overload the mirrors.
> You have to use bashisms or perl (or some really crude sh pipe) to make
> sure freshclam's cron job does not start exactly on the hour.

Why wouldnt you use this minute section?

 field  allowed values
  -  --
  minute 0-59
  hour   0-23
  day of month   1-31
  month  1-12 (or names, see below)
  day of week0-7 (0 or 7 is Sun, or use names)




-- 
===
Jabber: tradergt@(smelser.org|jabber.org)
Quote:I don't know what I like, but I know what art is.
===


pgpdWNh0MzjD7.pgp
Description: PGP signature


Re: [Clamav-users] freshclam: crontab vs. daemon

2004-09-06 Thread Thomas Lamy
Daniel S. Cohen wrote:
Hello,
I am wondering if there is any advantage of running freshclam as a
daemon as oppposed to running it from the crontab a few times day?
Thanks.
Dan
It's a matter of taste. I prefer running it in daemon mode, as freshclam 
is rock solid (eg. it hasn't crashed here for months), and due to it's 
random start time does not tend to overload the mirrors.
You have to use bashisms or perl (or some really crude sh pipe) to make 
sure freshclam's cron job does not start exactly on the hour.

Thomas

---
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
___
Clamav-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/clamav-users


Re: [Clamav-users] freshclam: crontab vs. daemon

2004-09-06 Thread Damian Menscher
On Mon, 6 Sep 2004, Damian Menscher wrote:
> On Mon, 6 Sep 2004, Daniel S. Cohen wrote:
>
> > I am wondering if there is any advantage of running freshclam as a
> > daemon as oppposed to running it from the crontab a few times day?
>
> More seriously, it saves init from forking another process for each
> check, and might buy you something in terms of having a fixed PID.  Or
> maybe your system doesn't support cron (or has it disabled for users).

Oh yeah, and it automatically handles staggering of updates, thereby
protecting the mirrors from dying every hour on the hour.  ;)  If you
run from crontab, be SURE you NEVER update between 0-5 mins after the
hour (to make up for all the idiots that ONLY update then).

Damian Menscher
-- 
-=#| Physics Grad Student & SysAdmin @ U Illinois Urbana-Champaign |#=-
-=#| 488 LLP, 1110 W. Green St, Urbana, IL 61801 Ofc:(217)333-0038 |#=-
-=#| 4602 Beckman, VMIL/MS, Imaging Technology Group:(217)244-3074 |#=-
-=#| <[EMAIL PROTECTED]> www.uiuc.edu/~menscher/ Fax:(217)333-9819 |#=-
-=#| The above opinions are not necessarily those of my employers. |#=-


---
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
___
Clamav-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/clamav-users


Re: [Clamav-users] freshclam: crontab vs. daemon

2004-09-06 Thread Damian Menscher
On Mon, 6 Sep 2004, Daniel S. Cohen wrote:

> I am wondering if there is any advantage of running freshclam as a
> daemon as oppposed to running it from the crontab a few times day?

Yes.  It maintains job security since it's another process that has the
potential to crash, thereby requiring you to restart it.  If you ran it
from crontab, you might get laid off due to the system being so stable
it didn't need an admin.

More seriously, it saves init from forking another process for each
check, and might buy you something in terms of having a fixed PID.  Or
maybe your system doesn't support cron (or has it disabled for users).

It's also convenient that it restricts the frequency of checks to 50/day
(unlimited if you enable DNS checks) and thereby prevents jerks from
checking for updates every 5 minutes.

Damian Menscher
-- 
-=#| Physics Grad Student & SysAdmin @ U Illinois Urbana-Champaign |#=-
-=#| 488 LLP, 1110 W. Green St, Urbana, IL 61801 Ofc:(217)333-0038 |#=-
-=#| 4602 Beckman, VMIL/MS, Imaging Technology Group:(217)244-3074 |#=-
-=#| <[EMAIL PROTECTED]> www.uiuc.edu/~menscher/ Fax:(217)333-9819 |#=-
-=#| The above opinions are not necessarily those of my employers. |#=-


---
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
___
Clamav-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/clamav-users


[Clamav-users] freshclam: crontab vs. daemon

2004-09-06 Thread Daniel S. Cohen
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hello,
I am wondering if there is any advantage of running freshclam as a
daemon as oppposed to running it from the crontab a few times day?
Thanks.
Dan
- --
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
- --
PGP Key: http://machine.technocraft.com/~dsc/pgpkey.html
[please encrypt emails to me when possible]
- --
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.4 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFBPKIL4CrJ04+9SNURAgGMAJ9gxZBQm9e6klR90kkDbD56+yFkNQCg6fdW
bZKJXrTqGAy1CBhX4Cn0OpQ=
=NZGd
-END PGP SIGNATURE-
---
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
___
Clamav-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/clamav-users