cPanel Cron Jobs – time interval

Home Forums BulletProof Security Pro cPanel Cron Jobs – time interval

This topic contains 14 replies, has 2 voices, and was last updated by  AITpro Admin 2 weeks, 5 days ago.

Viewing 15 posts - 1 through 15 (of 15 total)
  • Author
    Posts
  • #38150

    Living Miracles
    Participant

    Hi,

    Earlier today, I disabled the WP crons via this code in the wp-config.php file:

    define('DISABLE_WP_CRON', true);

    And then I added a cron via cPanel to run every 5 minutes:

    wget -q -O - https://example.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

    I then wanted to test ARQ to make sure the crons were working. I uploaded a file to the /public_html directory of the site that ARQ should have quarantined. I waited for a long time to see if the file would get quarantined but it never did.

    Can you tell me if I need to change something for the BPS Pro crons to continue functioning?

    We’d like to set up the cron jobs via cPanel for troubleshooting and reducing the load on our server. I confirmed with our server/hosting support that the crons are working:

    They monitored the server cron logs and the cron job is properly executed:

    [2019-11-10 19:25:01]: CMD: oursite wget -q -O - https://example.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
    
    

    Thank you!
    Jutta

    #38151

    AITpro Admin
    Keymaster

    First you need to change your cron interval time to 1 minute.  1 minute works for WordPress, all other plugins and themes.  Anything other than a 1 minute cron interval will cause problems for WordPress, all other plugins and themes.

    Next check your BPS Pro Security Log to see if your wget cron is being blocked.  If it is then do the fix in this forum topic > https://forum.ait-pro.com/forums/topic/rss-link-bomber-cron-job-blocked/

    #38169

    Living Miracles
    Participant

    Hi there,

    I’ve set the crons to run every minute now (done a few hours ago). It still doesn’t appear that ARQ is working however.

    I’m not seeing anything in the security log that indicates the crons being blocked. However, I did try out the code from the forum topic you mentioned, but it didn’t seem to make any difference.

    Any other thoughts?

    #38176

    AITpro Admin
    Keymaster

    Assuming that crons are actually really working… What type of hosting do you have?  Standard shared hosting, some kind of managed WordPress shared hosting, VPS or Dedicated hosting server?  Was AutoRestore working correctly before you disabled WordPress Crons?

    #38178

    Living Miracles
    Participant

    Well, SiteGround support did confirm, by checking the logs that the cron was working fine.

    We have a dedicated server with SiteGround, and yes, AutoRestore was working before we disabled the WP crons.

    #38179

    AITpro Admin
    Keymaster

    Ok so what you need to do next is to do BPS Pro troubleshooting step #1 and see if the the direct cron, which uses wget is being blocked by in the BPS root htaccess file.  The BPS root htaccess file blocks wget requests by default.

    #38226

    Living Miracles
    Participant

    Hi,
    Thanks. Could you double-check the link you tried sharing with me? It doesn’t work for me.

    #38229

    Living Miracles
    Participant

    Hi,

    I just noticed you updated the link. Thanks. I disabled Root Folder BulletProof Mode according to the troubleshooting step #1 and also changed my .htaccess file to a default WP .htaccess file to see if anything would change with the cron.

    I tested ARQ again by uploading some new files into the website’s root. Again, nothing is getting quarantined, so it might not be anything in the .htaccess file that’s blocking the crons. Can you think of anything else that might be problematic here?

     

    #38230

    AITpro Admin
    Keymaster

    Ok so yeah then the only explanation is there is a problem with WordPress Crons on your website.  AutoRestore runs a cron job that checks files to see if they have changed or not.  Assuming you have set the Autorestore cron frequency to run every 2 minutes then the new uploaded files should be quarantined when the next ARQ cron job runs.

    #38231

    Living Miracles
    Participant

    I actually set the cron to run every minute since that’s what you suggested before.

    Is this something I should reach out to SiteGround support for then? If so, can you suggest how I steer the question to them so they know what to possibly look for?

     

    #38232

    AITpro Admin
    Keymaster

    You could just not disable WordPress Crons of course. 😉  AutoRestore definitely works with Direct Crons as long as they are setup correctly.  So either the Direct Cron is not really setup correctly or you have some other problem occurring with Crons on your server/website.

    I think SiteGround has already looked at this issue and can’t find anything wrong.  My recommendation is of course to put things back the way they were.  WordPress crons should not cause any significant resource usage so really there is no need to disable them.

    #38234

    Living Miracles
    Participant

    Yea, the reason we’d like to disable the crons is to reduce load on our server (as part of some other steps we’re taking for this as well).

    #38236

    AITpro Admin
    Keymaster

    Ok well if crons are causing significant load issues on your server then your server has configuration problems.  WordPress crons do not normally cause any significant or noticeable resource usage.

    #38237

    Living Miracles
    Participant

    Well, I guess when we have significant traffic to our sites—possibly SEO traffic—, our server tends to go down temporarily and SiteGround suggested that we turn off the Heartbeat API and set up manual crons via cPanel.

    #38238

    AITpro Admin
    Keymaster

    Turning off the Heartbeat API is information that is several years old.  WordPress addressed and fixed any and all issues with the Heartbeat API.  It has been fixed for years so yeah not a possible cause unless of course your server has configuration problems.  If your server is going down just from visitor traffic then yep you definitely have server configuration problems.

Viewing 15 posts - 1 through 15 (of 15 total)

You must be logged in to reply to this topic.