Discover Centmin Mod today
Register Now

Wordpress Wordpress crontab

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

  1. joshuah

    joshuah Member

    116
    14
    18
    Apr 3, 2017
    Ratings:
    +16
    Local Time:
    5:40 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

    30,156
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    4:40 AM
    Nginx 1.13.x
    MariaDB 5.5
    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

    116
    14
    18
    Apr 3, 2017
    Ratings:
    +16
    Local Time:
    5:40 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

    30,156
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    4:40 AM
    Nginx 1.13.x
    MariaDB 5.5
    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

    116
    14
    18
    Apr 3, 2017
    Ratings:
    +16
    Local Time:
    5:40 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

    30,156
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    4:40 AM
    Nginx 1.13.x
    MariaDB 5.5
  7. Gavin

    Gavin New Member

    12
    5
    3
    Mar 18, 2017
    Ratings:
    +7
    Local Time:
    1:40 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

    30,156
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    4:40 AM
    Nginx 1.13.x
    MariaDB 5.5
    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

    30,156
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    4:40 AM
    Nginx 1.13.x
    MariaDB 5.5
    haha first 5 google results show minus =1 in them heh

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

    joshuah Member

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

    eva2000 Administrator Staff Member

    30,156
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    4:40 AM
    Nginx 1.13.x
    MariaDB 5.5
    Yeah manually fix it for now not that it matters so much as the cronjob is disabled by default.
     
  12. joshuah

    joshuah Member

    116
    14
    18
    Apr 3, 2017
    Ratings:
    +16
    Local Time:
    5:40 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
     
    • Agree Agree x 1
  13. Gavin

    Gavin New Member

    12
    5
    3
    Mar 18, 2017
    Ratings:
    +7
    Local Time:
    1:40 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?
     
    • Informative Informative x 1
  14. eva2000

    eva2000 Administrator Staff Member

    30,156
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    4:40 AM
    Nginx 1.13.x
    MariaDB 5.5
    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

    116
    14
    18
    Apr 3, 2017
    Ratings:
    +16
    Local Time:
    5:40 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.
     
    • Like Like x 2
  16. eva2000

    eva2000 Administrator Staff Member

    30,156
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    4:40 AM
    Nginx 1.13.x
    MariaDB 5.5
    nice idea... will test and see
     
    • Like Like x 1
  17. joshuah

    joshuah Member

    116
    14
    18
    Apr 3, 2017
    Ratings:
    +16
    Local Time:
    5:40 AM
    Just touching base to see if you had any further thoughts on this?
     
  18. eva2000

    eva2000 Administrator Staff Member

    30,156
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    4:40 AM
    Nginx 1.13.x
    MariaDB 5.5
    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 Member

    201
    15
    18
    Feb 21, 2017
    Ratings:
    +21
    Local Time:
    8:40 PM
  20. eva2000

    eva2000 Administrator Staff Member

    30,156
    6,785
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,136
    Local Time:
    4:40 AM
    Nginx 1.13.x
    MariaDB 5.5