Ok;
After running that a few days, it works fine, but... the interval between
updates
is all over the place.
I rewrote it, to only change the sleep value under 2 circumstances:
First time run, or after a failure.
Now it's updating hourly again.
I will not make the same mistake of posting it t
> #!/bin/sh
> remaining=$1;shift
> cmd=$@
> lock=/var/run/$(basename $1).lock
> [ -f $lock ] || {
> touch $lock
> while [ $remaining -gt 0 ]; do
> seconds=$(($RANDOM % $remaining))
> echo $(date) $seconds >> $lock
> sleep $seconds
> $cmd && return || remaining=$(($remaining - $s
On Fri, Jun 01, 2012 at 03:47:21PM +1000, David Diggles wrote:
[ snip ]
> sleep $s
[ snip ]
Arghh.. ;-) sleep $seconds here
Anyway, you get the idea.
#!/bin/sh
remaining=$1;shift
cmd=$@
lock=/var/run/$(basename $1).lock
[ -f $lock ] || {
touch $lock
while [ $remaining -gt 0 ]; do
sec
On Tue, May 29, 2012 at 09:51:54AM +0200, Bret Lambert wrote:
> > Please avoid 15 minutes past the hour ;-)
>
> sleep $(($RANDOM % 2048)) && /usr/libexec/spamd-setup -d
Tried something like the above, and found it still
fails at peak times, so I am trying something else:
I made a wrapper called
On May 29 09:14:29, Peter N. M. Hansteen wrote:
> On Tue, May 29, 2012 at 08:24:07AM +0200, Jan Stary wrote:
>
> > When I run the same command from the command line,
> > everything goes fine. Is the cron job run in a more
> > restricted environment?
>
> you could be hitting the 'zero minute rush
On Tue, May 29, 2012 at 9:50 AM, Mitja MuE>eniD
wrote:
> Years ago I've been toying with the idea of having a flag for random-delay
> mode in spamd-setup. So the default cronjob is still set at zero minute,
but
> spamd-setup then waits for random amount of minutes before hitting the
> server. You
> > you could be hitting the 'zero minute rush', where world+dog tries to
> > connect simultaneously. try shifting to a few minutes past the hour
> and
> > see if that helps.
> >
>
> Please avoid 15 minutes past the hour ;-)
Years ago I've been toying with the idea of having a flag for random-de
> Please avoid 15 minutes past the hour ;-)
sleep $(($RANDOM % 2048)) && /usr/libexec/spamd-setup -d
A random sleep between 0 and 3599 prior to running
spamd-setup in cron would not go astray.
On Tue, May 29, 2012 at 09:23:43AM +0200, Gilles Chehade wrote:
> On Tue, May 29, 2012 at 09:14:29AM +0200, Peter N. M. Hansteen wrote:
> > On Tue, May 29, 2012 at 08:24:07AM +0200, Jan Stary wrote:
> >
>
On Tue, May 29, 2012 at 09:14:29AM +0200, Peter N. M. Hansteen wrote:
> On Tue, May 29, 2012 at 08:24:07AM +0200, Jan Stary wrote:
>
> > When I run the same command from the command line,
> > everything goes fine. Is the cron job run in a more
> > restricted environment?
>
> you could be hitting
On Tue, May 29, 2012 at 08:24:07AM +0200, Jan Stary wrote:
> When I run the same command from the command line,
> everything goes fine. Is the cron job run in a more
> restricted environment?
you could be hitting the 'zero minute rush', where world+dog tries to
connect simultaneously. try shif
Change it to this:
* * * * /usr/libexec/spamd-setup -d
It will probably fix the problem.
On Tue, May 29, 2012 at 08:24:07AM +0200, Jan Stary wrote:
> Pretty current 5.1-current/amd64.
> This is what happens with the following line in root's crontab
>
> 0 * * * * /usr/libexec/spamd-setup
Pretty current 5.1-current/amd64.
This is what happens with the following line in root's crontab
0 * * * * /usr/libexec/spamd-setup -d
On May 29 03:00:02, Cron Daemon wrote:
> Getting http://www.openbsd.org/spamd/traplist.gz
> spamd-setup: Could not add blacklist uatraps: Illegal seek
> G
13 matches
Mail list logo