0

Having problems deploying CiviCRM. Do not fully understand how to implement documentation.

I ran this

sudo crontab -e

and added this to the file

*/1 * * * * daemon /opt/bitnami/php/bin/php /bitnami/wordpress/wp-content/plugins/civicrm/civicrm/bin/cron.php > /dev/null

Then I restarted the machine

Still shows in CiviCRM system status ‘Set-up Cron’

How many things have I just done wrong, and how can I do it right?

1
  • 1
    Welcome. This reads more like you're venting frustration than asking a question that someone can help you with. I don't think anyone knows the answer to how many things you've done wrong, or can rephrase an entire book for you, but if you reference a specific error message, or have a specific question about a particular sentence in the documentation, I think you'll find people here are very friendly and helpful.
    – Coleman
    Sep 10, 2023 at 17:02

1 Answer 1

1

I found a fix

Here are the steps you need to follow to set up a Cron job for your WordPress Bitnami Nginx website:

  1. Choose a CMS User: Create a new WordPress user that will be used to run the cron jobs. For example, you can create a user named 'cronuser'. Make sure this user has all the necessary permissions.

  2. Install WP-CLI: WP-CLI is a command line tool for managing your WordPress site. You can install it using the following commands:

    curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
    chmod +x wp-cli.phar
    sudo mv wp-cli.phar /usr/local/bin/wp

  3. Test WP-CLI: You can test if WP-CLI is working properly by navigating to your WordPress directory and running the following command:

    wp --info

  4. Prepare the WP-CLI Command: The command to execute the Job.execute API call using WP-CLI is:

    wp --user=cronuser --url=http://example.org --path=/path/to/wordpress/ civicrm api job.execute auth=0

(Replace 'cronuser' with the WordPress user you created, 'http://example.org' with your website's URL, and '/path/to/wordpress/' with the path to your WordPress installation.)

  1. Test the Command: You can test the command by running it in your terminal. If it runs without errors, you can proceed to the next step.

  2. Setup the Cron Job: Open your crontab file by running crontab -e in your terminal. Add the following line to run the command every 5 minutes:

    */5 * * * * wp --user=cronuser --url=http://example.org --path=/path/to/wordpress/ civicrm api job.execute auth=0

(Replace the values as you did in the previous step.)

  1. Save and Close: Save the crontab file and close it. Your cron job is now set up and will run every 5 minutes.

(Remember to replace the placeholders in the commands with your actual data. Also, make sure the user you are using for the cron job has the necessary permissions in your WordPress site.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.