Welcome to Centmin Mod Community
Register Now

Wordpress Wordpress crontab

Discussion in 'Blogs & CMS usage' started by joshuah, May 3, 2017.

  1. joshuah

    joshuah Member

    121
    14
    18
    Apr 3, 2017
    Ratings:
    +17
    Local Time:
    6:04 AM
    Hi,

    Just looking at the crontab entry that is created automatically when WP is installed (option 22). Just wondering how come the cron entry is disabled by default "#"?

    Code:
    #*/15 * * * * sleep 307s ; wget -O - -q -t 1 http://domain.tld/wp-cron.php?doing_wp_cron=1 > /dev/null 2>&1


     
  2. eva2000

    eva2000 Administrator Staff Member

    55,797
    12,271
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,857
    Local Time:
    6:04 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    some folks it wasn't running so to be safe disabled it in cron and re-enabled wp's own native cron :)
     
  3. joshuah

    joshuah Member

    121
    14
    18
    Apr 3, 2017
    Ratings:
    +17
    Local Time:
    6:04 AM
    Understood. What URL to curl/wget or method do you recommend to generate traffic on each website every 15 minutes or so just to ensure the native cron actually executes.
     
  4. eva2000

    eva2000 Administrator Staff Member

    55,797
    12,271
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,857
    Local Time:
    6:04 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    That url listed worked for me but you can try other suggested urls from google-fu foo to see which works for you :)
     
  5. joshuah

    joshuah Member

    121
    14
    18
    Apr 3, 2017
    Ratings:
    +17
    Local Time:
    6:04 AM
    Oh, so you mean that the cron (uncommented) works for you? Just not for some users? What is the best way to see if it's not working? Like is there some kind on error?
     
  6. eva2000

    eva2000 Administrator Staff Member

    55,797
    12,271
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,857
    Local Time:
    6:04 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  7. Gavin

    Gavin New Member

    12
    5
    3
    Mar 18, 2017
    Ratings:
    +7
    Local Time:
    3:04 PM
    1.13.x
    10.1.x
    Ah that makes me feel better. I was having an issue with it, after some experimenting...removing the "=1"

    Code:
    */15 * * * * sleep 307s ; wget -O - -q -t 1 http://domain.tld/wp-cron.php?doing_wp_cron > /dev/null 2>&1
    Deleting that portion allowed my autoupdate checks in Ninjafirewall to trigger though. Googling I couldn't really find concise information about why the =1 was added. The only info I found seemed to indicate that =1xxxx sometimes happens when the url is given a post id?

    Anyway, will removing the =1 portion cause any problems?
     
    Last edited: May 4, 2017
  8. eva2000

    eva2000 Administrator Staff Member

    55,797
    12,271
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,857
    Local Time:
    6:04 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Ah if removing =1 works for you then yes use it.. will have to google-fu some more myself :)
     
  9. eva2000

    eva2000 Administrator Staff Member

    55,797
    12,271
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,857
    Local Time:
    6:04 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    haha first 5 google results show minus =1 in them heh

    Will update centmin.sh menu option 22 :D
     
  10. joshuah

    joshuah Member

    121
    14
    18
    Apr 3, 2017
    Ratings:
    +17
    Local Time:
    6:04 AM
    Awesome! For existing sites I presume we will just need to manually fix the cron entries?
     
  11. eva2000

    eva2000 Administrator Staff Member

    55,797
    12,271
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,857
    Local Time:
    6:04 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Yeah manually fix it for now not that it matters so much as the cronjob is disabled by default.
     
  12. joshuah

    joshuah Member

    121
    14
    18
    Apr 3, 2017
    Ratings:
    +17
    Local Time:
    6:04 AM
    Oh and it looks like we need to append

    Code:
    define('DISABLE_WP_CRON', true); 
    In the wp-config.php if using a real cron
     
  13. Gavin

    Gavin New Member

    12
    5
    3
    Mar 18, 2017
    Ratings:
    +7
    Local Time:
    3:04 PM
    1.13.x
    10.1.x
    Just gonna add that while this was giving me issues and until I was able to figure out that removing the =1 would get wp-cron.php to fire.

    I found a post that suggested using an uptime monitor to fire wp-cron.php by using
    http://domain.tld/wp-cron.php?doing_wp_cron as your uptime monitor url (for something like Pingdom)

    I thought that was a pretty nifty idea and it worked great until I pinpointed why the cronjob wasnt working. Currently, using both just cause Pingdom has been having some issues lately, but may just delete the cronjob?
     
  14. eva2000

    eva2000 Administrator Staff Member

    55,797
    12,271
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,857
    Local Time:
    6:04 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    nifty idea indeed
    yes you'd need to do that too - centmin.sh menu option 22 sets the value to false, so just change to true
     
  15. joshuah

    joshuah Member

    121
    14
    18
    Apr 3, 2017
    Ratings:
    +17
    Local Time:
    6:04 AM
    @eva2000 is it possible to please prompt the users during the wordpress install (option 22) if they want to run:

    1. System cron (Recommended)
    2. Default wp-cron.php

    It is recommended across the board to disable the wp-cron.php and just run it from the crontab every 6 hours or so.
     
  16. eva2000

    eva2000 Administrator Staff Member

    55,797
    12,271
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,857
    Local Time:
    6:04 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    nice idea... will test and see
     
  17. joshuah

    joshuah Member

    121
    14
    18
    Apr 3, 2017
    Ratings:
    +17
    Local Time:
    6:04 AM
    Just touching base to see if you had any further thoughts on this?
     
  18. eva2000

    eva2000 Administrator Staff Member

    55,797
    12,271
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,857
    Local Time:
    6:04 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    nothing from my end right now - you'd have to manually enable system cron run for wordpress cron if you opt for such
     
  19. ahmed

    ahmed Active Member

    361
    49
    28
    Feb 21, 2017
    Ratings:
    +63
    Local Time:
    10:04 PM
  20. eva2000

    eva2000 Administrator Staff Member

    55,797
    12,271
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,857
    Local Time:
    6:04 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+