cwd*_*cwd 43 command-line cron files locate
在新的 Ubuntu 10.4 实例上,我尝试使用该locate
命令仅接收错误
locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory
Run Code Online (Sandbox Code Playgroud)
在其他系统上使用此命令时,我猜测这意味着尚未构建数据库(这是全新安装)。我相信它应该每天运行,但我如何将它排队立即运行?
另外,“每天运行”是如何确定的?如果我有一个每次只打开一个小时的盒子,数据库是否会自行构建?
enz*_*tib 67
cron 作业在/etc/cron.daily/mlocate
.
要立即运行它:
sudo updatedb
Run Code Online (Sandbox Code Playgroud)
或更好
sudo ionice -c3 updatedb
Run Code Online (Sandbox Code Playgroud)
这更好,因为updatedb
是在Idle I/O 调度类中设置的,这样它就不会干扰(从 I/O 的角度来看)其他应用程序。从ionice
手册页:
Run Code Online (Sandbox Code Playgroud)-c class The scheduling class. 0 for none, 1 for real time, 2 for best-effort, 3 for idle. ........................ Idle A program running with idle io priority will only get disk time when no other program has asked for disk io for a defined grace period. The impact of idle io processes on normal system activity should be zero. This scheduling class does not take a priority argument. Presently, this scheduling class is permitted for an ordinary user (since kernel 2.6.25).
归档时间: |
|
查看次数: |
52900 次 |
最近记录: |