linuxmint / cinnamon

A Linux desktop featuring a traditional layout, built from modern technology and introducing brand new innovative features.
GNU General Public License v2.0
4.48k stars 730 forks source link

updatedb cronjob not running. 'locate' works after I manually run updatedb #12336

Open ajlewis2 opened 1 month ago

ajlewis2 commented 1 month ago

Distribution

Mint 22.1

Package version

6.2.7

Graphics hardware in use

No response

Frequency

Always

Bug description

'locate' command produces no results. Run 'sudo updatedb' and then locate produces results. This looks like a daily cron job which I find in /etc/cron.daily/locate. This is a new problem with my upgrade from 21.3 to 22

Steps to reproduce

As stated above.

Expected behavior

'locate' should show me things on my system with the name I indicate

Additional information

No response

ajlewis2 commented 1 month ago

Additional information which shows that the cronjob is running upon boot, but is not giving results from user directory, only from system files:

/var/cache/locate/locatedb

This file is updated when system booted this morning. However, running 'locate' gives me only results in the system outside my user directory.

Run sudo updatedb

locatedb is updated and is now 3Mb larger than earlier.

running 'locate' with the same argument gives me additional results that exist in my user directory.

ajlewis2 commented 1 month ago

Looks like I solved. There is another system besides cron that does this daily update. It is set to run within 12 hours of boot. I changed the setting to 1 hour and that gets the job done before I'm ready to use 'locate'

The file is: /usr/lib/systemd/system/plocate-updatedb.timer

I changed the line: RandomizedDelaySec=12h

to: RandomizedDelaySec=1h

That doesn't fix the problem with cron, but it fixes the problem I needed fixing.