• Resolved slapbox

    (@slapbox)


    We have a crontab setup that triggers wp-cron.php regularly on our server, but on the staging site it doesn’t cause the cron jobs to run even when configured identically but for the file paths, nor does visiting the staging wp-cron.php in our browser (either logged in or out.)

    (Note: absolute paths redacted with [...])

    */1 * * * * cd [...]htdocs; php [...]htdocs/wp-cron.php > /dev/null 2>&1 # PROD - Works
    */1 * * * * cd [...]htdocs/july2022-staging; php [...]htdocs/july2022-staging/wp-cron.php > /dev/null 2>&1 # Staging - Does nothing

    I’ve tried with and without this in our staging wp-config.php:

    define('DISABLE_WP_CRON', true);

    What could be the issue? We need to test cron on our staging site and the docs suggest it isn’t disabled or affected by WP-Staging, but that doesn’t seem to be the case for us.

    Thanks for the great plugin!

    • This topic was modified 2 years, 4 months ago by slapbox.
Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter slapbox

    (@slapbox)

    And it turns out this is all wrong and user error, as usually is the case; so ignore this issue. Thank you again!

    • This reply was modified 2 years, 4 months ago by slapbox.
    Thread Starter slapbox

    (@slapbox)

    Nope, jobs really don’t run! I don’t know what it could be!

    Plugin Author Rene Hermenau

    (@renehermi)

    Hi,

    Disabling the authentication form will solve it. You can read more about that here:
    https://www.ads-software.com/support/topic/does-wp-staging-stop-the-woocommerce-data-retention-cron/

    Please let me know if it works.

    Cheers,
    René

    Thread Starter slapbox

    (@slapbox)

    Turns out the cron jobs just needed more time to process because of a backlog.

    Plugin Author Rene Hermenau

    (@renehermi)

    Great to hear. Hope the staging site will be helpful for you.

    Thread Starter slapbox

    (@slapbox)

    For anyone facing this in the future – even if you have a crontab job to trigger wp-cron.php on the staging site – it seems like the first invocation must be from manually triggering it in the browser. Before that, our crontab job didn’t get the WP cron jobs to run, but after manually triggering wp-cron.php once, it seems to run as expected afterward.

    I wonder if this behavior is unexpected @renehermi?

    Thanks again very much for the great plugin!

    Plugin Author Rene Hermenau

    (@renehermi)

    @slapbox This is new to me and not expected behavior. I wonder what happens if you disable WP STAGING completely on the staging site? Then it should work exactly as the live site.

    Curious to hear what you experience.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Cron jobs won’t run on staging site’ is closed to new replies.