• Resolved catuyen

    (@catuyen)


    Hi
    I am trying to create a cronjob for Algolia auto reindex post/page. The command is:

    */30 * * * * wp algolia reindex --all >> /home/mywebsites/web/example.com/logs/algolia-reindex.log 2>&1

    However, the log file shows the error below:

    /bin/sh: 1: wp: not found

    The correct wp-cli path is: /usr/local/bin

    How can I correct the command/path … to get it working?

    Thank you for your help.
    Uyen

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Perhaps try specifying /usr/local/bin/wp algolia reindex --all as part of the cron job command.

    Worth a quick shot. Beyond that, make sure that /usr/local/bin/wp is executable and perhaps try the commands out manually to make sure they’re working like expected for some extra assurance.

    Thread Starter catuyen

    (@catuyen)

    Thank you for your respond

    The command below will do the job

    /usr/local/bin/wp --path='/home/mywebsites/web/example.com/public_html' algolia reindex --all

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Glad to see you found a working solution for this.

    Let us know if you need anything else.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to create cronjob for auto reindex?’ is closed to new replies.