标准的Unix方法是cron
,所以你可以编辑/etc/crontab
和添加一行像
*/5 * * * * root sphynx [whatever other options you need]
Run Code Online (Sandbox Code Playgroud)
意思是
另一个例子:'4 5**6'相当于每周六上午5:04(五点钟后四分钟)(一周中的一天是6).
您可能需要或想要将用户从root切换到,例如,www-data是sphynx运行的那样,您显然需要调整参数.
最后,查看目录
$ ls -1d /etc/cron.*
/etc/cron.d
/etc/cron.daily
/etc/cron.hourly
/etc/cron.monthly
/etc/cron.weekly
Run Code Online (Sandbox Code Playgroud)
例如---其他包把他们的工作放在那里(这种机制比直接编辑更通用,更新/etc/crontab
.