[問題] Reschedule updatedb.mlocate

看板Linux作者 (夏宇)時間11年前 (2014/10/03 07:42), 編輯推噓0(009)
留言9則, 1人參與, 最新討論串1/1
我的系統(Ubuntu 14.04)每天早上六點多都會自動執行updatedb.mlocate 我想把他改到晚上九點多執行 有試著修改/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 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin # m h dom mon dow user command 17 * * * * root cd / && run-parts --report /etc/cron.hourly 0 21 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --rep ort /etc/cron.daily ) 22 21 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --rep ort /etc/cron.weekly ) 27 21 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --rep ort /etc/cron.monthly ) # 不知道我哪裡弄錯了,請指教 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 140.112.51.113 ※ 文章網址: http://www.ptt.cc/bbs/Linux/M.1412293340.A.16E.html

10/03 12:36, , 1F
請先理解anacron倒底是什麼...
10/03 12:36, 1F

10/03 12:36, , 2F
後面那三行在有anacron的狀態下是裝飾用的
10/03 12:36, 2F

10/03 12:42, , 3F
如果要強制指定locate db更新時間就把
10/03 12:42, 3F

10/03 12:42, , 4F
他從cron.daily移除 然後手動加進crontab裡
10/03 12:42, 4F

10/03 12:43, , 5F
如果要改變整個anacron可運行時間就改/etc/anacrontab
10/03 12:43, 5F

10/03 12:43, , 6F
不過這看你到底為何要改這時間了...
10/03 12:43, 6F

10/03 12:44, , 7F
如果要避開特定時段浪費資源...
10/03 12:44, 7F

10/03 12:44, , 8F
其實locate都不該用了
10/03 12:44, 8F

10/03 12:44, , 9F
如果是怕那時段沒開機不會跑到 這部分anacron會處理
10/03 12:44, 9F
文章代碼(AID): #1KBUBS5k (Linux)
文章代碼(AID): #1KBUBS5k (Linux)