I found a fix
Here are the steps you need to follow to set up a Cron job for your WordPress Bitnami Nginx website:
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.
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
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
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.)
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.
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.)
- 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.)