Marinus Klasen

Marinus Klasen

  • Development
  • Consultancy
  • Developer Resources
  • Blog
  • Contact

March 16, 2022

Managing cronjobs in Cloudways

Marinus Klasen

Cloudways comes with an easy tool to create basic cronjobs, but what if we want to run more advanced cronjobs? Or, execute WordPress cronjobs via wp-cli?

Let’s dive into the setup on Cloudways!

Managing your application

Go to your application settings, and click on Cron Job Management.

You’ll see two tabs: Basic and Advanced, select the advanced tab.

You can now enter manual cronjobs.

The one I entered (the text below is a bit different from the screenshot) is:

*/10 * * * * /usr/local/bin/wp cron event run --due-now --path=/home/master/applications/{application_id}/public_html/ >> /home/master/logs/cron.log  2>&1

This translated to: Run the wp-cli comment “cron event run” every 10 minutes for this application and log the output to ~/logs/cron.log. (make sure to create this file first)

How to disable WordPress’ native cronjobs that execute on page load?

Add this to your wp-config.php file: define('DISABLE_WP_CRON', true);

How to time these cronjobs?

Honestly – every time I create a cronjob, I get my configuration from: https://crontab.guru/examples.html
This beautiful tool makes cronjobs so much easier!

Where does /usr/local/bin/wp come from?

/usr/local/bin/wp is where the wp-cli tool lives, you can find that path by entering which wp in your terminal when connected via SSH.

Where do I find my application ID?

Your application ID is the same as your application username. You’ll find it in Access Details.

How do I create the cron.log file?

Connect to your server using SSH, and then run:

touch ~/logs/cron.log

About Marinus Klasen

Marinus has been working in software/web development for more than a decade. Since 2020 his attention shifted on sharing knowledge and developing products and tools for sharing knowledge.

Marinus Klasen on Twitter

Looking for a WordPress expert?
Hire top notch developers on Codeable!

Consult an expert

Comments

  1. Ed says

    November 16, 2022 at 8:44 am

    How often/many times an hr can you run a Cron with cloudways? For example Dreamhost let you do only 12 per hr

    Reply
    • Marinus Klasen says

      November 18, 2022 at 4:16 pm

      Up to a minute, and with some creativity, even up to seconds!

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Get in touch

Contact me using the details below

Marinus Klasen

Wilhelmina van Pruisenweg 35, 2595 AN Den Haag

marinus@mklasen.com
twitter.com/marinusklasen
linkedin.com/in/marinusklasen

  • GitHub
  • LinkedIn
  • Twitter

Have you read?

  • Elementor Widget UsageMarch 27, 2025
  • Programmatically showing popups with ElementorMarch 25, 2025
  • The Elementor sanitize_settings errorSeptember 12, 2024
  • Announcing.. Wooping Shop Health!June 13, 2024
  • Swiper setup when using wp-scriptsMarch 14, 2024

Copyright © 2025 ยท Marinus Klasen | Webdesign by Team Rood