----- Original Message -----
From: "Ron Bouwhuis" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, September 29, 2001 12:16 PM
Subject: Re: [newbie] crontab -e doesn't work...


> > >so that it runs my scan that adds nimda and code
> > red clients to my ipchains
> > >rules to block them...
> > >
> > >it needs to run alot so I figure that every five
> > minutes would be good.
> > >(have I done that right?)
> >
>
> Frank,
>
> Cron has its uses, but is sometimes fiddly.  It's also
> more suited to running administrative tasks at certain
> times of the day, week, month etc. rather than what I
> think you are trying to do.  I saw other posts helping
> you understand both the editing of your crontab and
> the meaning of the entries, so I won't go into a
> discussion on that.
>
> If all you want to do is run some code every 5
> minutes, a simple alternative is to put it in a
> script, inside a loop and put a sleep 300 command at
> the end of the loop. (Or you could use sleep 5m).  As
> the sleep won't start until after your previous
> commands finish, you don't have to worry about having
> several invokations running at the same time.
>
> To illustrate the syntax:
>
> while [ x = x ]
> do
>   <your command(s) go in here>
>   sleep 300
> done
>
> say you put this script in a file called block_nimda,
> you could then run it as follows:
>
> nohup ./block_nimda &
>
> This will run block_nimda script in background and
> protect it from a hang-up signal when you log-off.
> There are other considerations, like writing all
> output to log files, with full path names, etc.  Oh,
> and to stop the command you need to use kill!
>
> Of course, you can go fancy and build it into your
> init.d scripts so it runs on boot.  If you need help
> on doing that, let me know (but try it first
> yourself!)
>
> Hope this helps!
> Ron.
>
> __________________________________________________
> Do You Yahoo!?
> Listen to your Yahoo! Mail messages from any phone.
> http://phone.yahoo.com
>
>


----------------------------------------------------------------------------
----


> Want to buy your Pack or Services from MandrakeSoft?
> Go to http://www.mandrakestore.com
>




Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to