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

Re: anacron can't run hourly?



On Friday, 22.07.2005 at 04:06 -0700, Jose Cedeno wrote:

> On 7/21/05, Pascal Hakim <pasc@redellipse.net> wrote:
> > 
> > On Wed, Jul 20, 2005 at 12:38:57PM +0800, phyrster wrote:
> > > Hi Debianers,
> > 
> > Hi,
> > 
> > >
> > > Can anacron run hourly jobs?
> > 
> > Nope. The smallest timespan that anacron can schedule jobs for is a day.
> > 
> > > My /etc/anacrontab reads like this:
> > >
> > > =================
> > > 1 5 cron.daily nice run-parts --report /etc/cron.daily
> > > 7 10 cron.weekly nice run-parts --report /etc/cron.weekly
> > > @monthly 15 cron.monthly nice run-parts --report
> > > /etc/cron.monthly
> > > ================
> > >
> > > I want to schedule mail fetching and sending for every few minutes, but from
> > > the information I got so far, it seems anacron can't handle hourly jobs.
> > 
> > You should be using cron for this. The real advantage of anacron comes in
> > when you want to make sure things like cron.daily run at least once a
> > day, when your computer is not always on.
> > 
> > Adding support for anacron to have hourly granularity would be possible,
> > but I can't really think of a situation where this would be desirable
> > (but feel free to file a wishlist bug against anacron if you can come up
> > with a situation where it would be useful to have such a feature!)
> 
> What about using a script that does what you want, goes to sleep for 1 hour 
> and then calls itself.

As mentioned above, you should use cron for scheduled jobs with a
frequency of more than daily.  However, given that you want to 'fetch
and send mail' periodically, it may be that you can what you ask using
the mail programs themselves.  For example, fetchmail can run in daemon
mode where it will look for new mail every N seconds (when started as
'fetchmail -d N'); also, many MTAs can be fairly easily configured to
run at intervals too.

Dave.

-- 
Please don't CC me on list messages!
...
Dave Ewart - davee@sungate.co.uk - jabber: davee@jabber.org
All email from me is now digitally signed, key from http://www.sungate.co.uk/
Fingerprint: AEC5 9360 0A35 7F66 66E9 82E4 9E10 6769 CD28 DA92

Attachment: signature.asc
Description: Digital signature


Reply to: