7

Use CLI instead of wget for GP-cron

  • Live

J
Jeff Young

I'd like an SSH command option similar to "gp site all-sites -gpcron-on " that creates a WP-CLI cronjob for my server sites with CLI instead of wget.

Currently, I have to manually add CLI cronjobs to make sure my wp-cron fires correctly.

This is the expression I use:
*/1 * * * * /usr/local/bin/wp --path=/var/www/MYSITE.URL/htdocs cron event run --due-now >/dev/null 2>&1

It would be preferable for me (and others) to run cronjobs via CLI as that mitigates wp-cron conflicts with caching from plugins (i.e. LSCache) and DNS (i.e. Cloudflare proxy IPs).

A

Activity Newest / Oldest

S

Steve Bell

Status changed to: Live

S

Steve Bell

This command doesn't exist (I don't think...), however, this is now active by default on all sites on Ubuntu 22.04, and it has been changed from wget to use WP-CLI. It's also now fully multisite compatible. Details can be found here:

gridpane.com/kb/wp-cron-and-gridpane/#2204

This isn't the exact thing that has been requested, but with it being active by default instead of having to be activated per site on the latest stack and all future stacks, I'm going to mark it as live.


J

Jeff Young

It's what I wanted! Now I just need to be able to update my custom (Hetzner) servers to 22.04 to take advantage...