Odd locate behavior

Chris Green cl at isbd.net
Mon Sep 16 13:17:10 UTC 2024


On Mon, Sep 16, 2024 at 09:04:45AM -0400, Little Girl wrote:
> Hey there,
> 
> Karl Auer wrote:
> >Little Girl wrote:
> 
> >> Have you done sudo updatedb to update the locate database?
> >
> >Good call! But isn't that done on a daily basis by cron? Otherwise
> >the database would be permanently out of date.
> 
> Yep:
> 
> 	ls /etc/cron.daily
> 
> It should run automatically every day, but a known weakness of cron
> is that if the computer isn't running at a cron job's scheduled time,
> it won't fire even when the computer is later turned on. If you shut
> down your computer, like I do every night, there may be cron jobs
> that aren't firing.

That shouldn't be true for jobs run by anacron, that's the whole point
of anacron.  It's run at system boot time to check if there were any
jobs that should have been run when the system was turned off. I've
certainly never had to run locate's database update manually, it has
always been updated automatically.

However it apparently doesn't check if a system is running on battery
so maybe that's what you have noticed.

-- 
Chris Green




More information about the ubuntu-users mailing list