2.5. Periodic indexing

2.5.1. Starting indexing

Indexing is performed either by the recollindex program, or by the indexing thread inside the recoll program (use the File menu). Both programs will use the RECOLL_CONFDIR variable or accept a -c confdir option to specify a non-default configuration directory.

Reasons to use either the indexing thread or the recollindex command:

I'll let the reader decide where my heart belongs...

If the recoll program finds no index when it starts, it will automatically start indexing (except if canceled).

The recollindex indexing process can be interrupted by sending an interrupt (^C, SIGINT) or terminate (SIGTERM) signal. Some time may elapse before the process exits, because it needs to properly flush and close the index. The indexing thread can be equivalently stopped from the menu.

After such an interruption, the index will be somewhat inconsistent because some operations which are normally performed at the end of the indexing pass will have been skipped (for exemple, the stemming and spelling databases will be inexistant or out of date). You just need to restart indexing at a later time to restore consistency. The indexing will restart at the interruption point (the full file tree will be traversed, but files that were indexed up to the interruption and are still up to date will not need to be reindexed).

recollindex has a number of other options which are described in its man page.

2.5.2. Using cron to automate indexing

The most common way to set up indexing is to have a cron task execute it every night. For example the following crontab entry would do it every day at 3:30AM (supposing recollindex is in your PATH):

30 3 * * * recollindex > /some/tmp/dir/recolltrace 2>&1
Or, using anacron:
1  15  su mylogin -c "recollindex recollindex > /tmp/rcltraceme 2>&1"


The usual command to edit your crontab is crontab -e (which will usually start the vi editor to edit the file). You may have more sophisticated tools available on your system.