在我的其中一台计算机 (C1) 中,plocate
数据库没有更新,请参阅下面的命令 #2,今天 03/21 运行,显示数据库上次更新时间为 03/14(手动更新)。配置似乎与另一台 (C2) 中的配置相同,在 C1 中可以正常工作。我发布了我认为相关的命令的输出。我不明白为什么它没有更新,尤其是考虑到:
- 根据下面第 1 项,每天执行 anacron 作业。
- 根据下面第 6 项,plocate 位于要执行的日常工作列表中。
- C2 中相同命令的输出是确切地
sysstat
相同,除了项目#2(这是问题)和项目#6(我在C2中没有)。
造成该问题的原因可能是什么? 我还能做什么来找出问题?
输出我认为相关的命令。
1.
$ sudo cat /var/spool/anacron/cron.daily
20240321
$ ll /var/lib/plocate/plocate.db
-rw-r----- 1 root plocate 17M Mar 14 10:58 /var/lib/plocate/plocate.db
$ cat /etc/cron.d/anacron
# /etc/cron.d/anacron: crontab entries for the anacron package
SHELL=/bin/sh
30 7-23 * * * root [ -x /etc/init.d/anacron ] && if [ ! -d /run/systemd/system ]; then /usr/sbin/invoke-rc.d anacron start >/dev/null; fi
$ cat /etc/anacrontab
# /etc/anacrontab: configuration file for anacron
# See anacron(8) and anacrontab(5) for details.
SHELL=/bin/sh
HOME=/root
LOGNAME=root
# These replace cron's entries
1 5 cron.daily run-parts --report /etc/cron.daily
7 10 cron.weekly run-parts --report /etc/cron.weekly
@monthly 15 cron.monthly run-parts --report /etc/cron.monthly
$ cat /etc/crontab
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
# You can also override PATH, but by default, newer versions inherit it from the environment
#PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be executed
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
$ ll /etc/cron.daily
total 56K
drwxr-xr-x 2 root root 4.0K Mar 12 09:31 ./
drwxr-xr-x 149 root root 12K Mar 14 11:17 ../
-rwxr-xr-x 1 root root 311 Oct 9 2021 0anacron
-rwxr-xr-x 1 root root 376 Oct 26 2021 apport
-rwxr-xr-x 1 root root 1.5K Apr 8 2022 apt-compat
-rwxr-xr-x 1 root root 384 Nov 19 2019 cracklib-runtime
-rwxr-xr-x 1 root root 123 Dec 5 2021 dpkg
-rwxr-xr-x 1 root root 377 Jan 24 2022 logrotate
-rwxr-xr-x 1 root root 1.3K Mar 17 2022 man-db
-rw-r--r-- 1 root root 102 Mar 23 2022 .placeholder
-rwxr-xr-x 1 root root 652 Dec 7 2020 plocate
-rwxr-xr-x 1 root root 518 Feb 2 2021 sysstat