Why is apache access log not showing GET requests related to cron job?

In my wp-config.php, I have

define('DISABLE_WP_CRON', true);

I am on a Mac (Catalina), and if I run from the terminal crontab - l I see

* * * * * wget -q -O - 'https://mysiite.com/wp-cron.php?doing_wp_cron&cron=true'; echo "wordpresscron" >> /somepath/stdout.log

In my log file, I see wordpresscron being echoed.

But when I view my apache access log I don’t see any GET requests related to the cron.

Now, if I manually enter at the terminal

wget -q -O - 'https://mysiite.com/wp-cron.php?doing_wp_cron&cron=true'

An entry gets written into the apache access log.

So I just can’t figure out what is going on. Seems my cron is working, but apache log is not showing this…

Ideas?

Edit:

Maybe this has something to do with the fact that I am changing the system time on my MAC to test the triggering of events?

For instance, take a look at this output showing jobs that are pending:

enter image description here

So there are some jobs to run. If I type from the terminal

wp cron event run --due-now

These pending jobs all get immediately completed. I modified my crontab a bit, it is now

* * * * * cd /sitefolder; wp cron event run --due-now; echo "ran cron" >> /users/brian/sites/stdout.log

And I see ran cron being echoed to the log.

So I am truly at a loss. It is as if the cron is running, and when the wp cron event run --due-now command is issued, it is ignored, and I can’t imagine the conditions under which it might be ignored when ran as a cron. Maybe when ran as cron it is being ignored because it sees that I made a system time change (although I can’t imagine why that would cause a command to be ignored). Or could it be a weird permissons issue, in which case at command line I have permissions to run wp cron event run --due-now, but the cron job somehow does not have permission?

Anyway, this is driving me nuts.

$299 Affordable Web Design WordPress

This article was republished from its original source.
Call Us: 1(800)730-2416

Pixeldust is a 20-year-old web development agency specializing in Drupal and WordPress and working with clients all over the country. With our best in class capabilities, we work with small businesses and fortune 500 companies alike. Give us a call at 1(800)730-2416 and let’s talk about your project.

FREE Drupal SEO Audit

Test your site below to see which issues need to be fixed. We will fix them and optimize your Drupal site 100% for Google and Bing. (Allow 30-60 seconds to gather data.)

Powered by

Why is apache access log not showing GET requests related to cron job?

On-Site Drupal SEO Master Setup

We make sure your site is 100% optimized (and stays that way) for the best SEO results.

With Pixeldust On-site (or On-page) SEO we make changes to your site’s structure and performance to make it easier for search engines to see and understand your site’s content. Search engines use algorithms to rank sites by degrees of relevance. Our on-site optimization ensures your site is configured to provide information in a way that meets Google and Bing standards for optimal indexing.

This service includes:

  • Pathauto install and configuration for SEO-friendly URLs.
  • Meta Tags install and configuration with dynamic tokens for meta titles and descriptions for all content types.
  • Install and fix all issues on the SEO checklist module.
  • Install and configure XML sitemap module and submit sitemaps.
  • Install and configure Google Analytics Module.
  • Install and configure Yoast.
  • Install and configure the Advanced Aggregation module to improve performance by minifying and merging CSS and JS.
  • Install and configure Schema.org Metatag.
  • Configure robots.txt.
  • Google Search Console setup snd configuration.
  • Find & Fix H1 tags.
  • Find and fix duplicate/missing meta descriptions.
  • Find and fix duplicate title tags.
  • Improve title, meta tags, and site descriptions.
  • Optimize images for better search engine optimization. Automate where possible.
  • Find and fix the missing alt and title tag for all images. Automate where possible.
  • The project takes 1 week to complete.