Cron Job to Rebuild Search Index | |
Since Tiki9, if you have a large site and do not use MySQL Full Text search, you should set up a Cron job to regularly rebuild the index. How to do it varies from server to server, but here is an example. For a fuller description of the commands themselves, please see Unified Index - from the command line
Add this line for a daily rebuild in Tiki11 and up 0 0 * * * cd /var/www/html/tiki; php console.php index:rebuild >/dev/null 2>&1
To set RAM to 4 GB, increase max execution time, force an initial index cleanup and log 0 0 * * * cd /var/www/html/tiki; php -dmemory_limit=4G -dmax_execution_time=300 console.php index:rebuild --force --log >/dev/null 2>&1
Tips
|
Works in Shell but not as a Cron Job | |
The environment for a cron job (e.g., the To find out what the Let's say the shell script is called Cron job to run shell script 0 0 * * * sh cron.sh >/dev/null 2>&1
cron.sh #!/bin/bash #this is the exact same setting as in the shell environment PATH=/home/useraccount/perl5/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/useraccount/bin #this is the actual command to rebuild the index php -dmemory_limit=4G -dmax_execution_time=300 /home/useraccount/public_html/console.php index:rebuild
alias
|