Hi,
I'm running a slice of ubuntu hardy.
I've installed sphinx, and I would like to run the sphinx indexer every x
minutes.
What is the best way to go about doing this?
Hi,
I'm running a slice of ubuntu hardy.
I've installed sphinx, and I would like to run the sphinx indexer every x
minutes.
What is the best way to go about doing this?
The standard Unix approach is cron
, so you could for example edit /etc/crontab
and add a line like
*/5 * * * * root sphynx [whatever other options you need]
which means
Another example: '4 5 * * 6' amounts to 'at 5:04am (four minutes after five) on every Saturday (day of the week is 6).
You may need to or want to switch the user from root to, say, www-data is sphynx runs as that, and you obviously need to adjust the arguments.
Lastly, look into the directories
$ ls -1d /etc/cron.*
/etc/cron.d
/etc/cron.daily
/etc/cron.hourly
/etc/cron.monthly
/etc/cron.weekly
for examples --- other packages put their jobs there (and this mechanism is more general, and newer, than direct editing of /etc/crontab
.