I'm working on a simple little coding project wherein I need to run a php script four times a day, which means a cron job, which I've never tried before. I've also been interested (for the heck of it) in cutting down the excessive WordPress cron actions. My websites don't need to check if their themes have been changed twice a day, or even once a week (though changing that behavior with the following is something else.) And WordPress calls the cron action on every page access, which is somewhat silly, but that's how WordPress has to work, apparently.
So, it's simple to edit one's wp-config.php file with "define ('DISABLE_WP_CRON', true)", which, not surprisingly, unhooks the default WordPress cron behavior.
Then, to re-ignite a more periodically robust schedule, one is to utilize one's cPanel Cron form to rehook the wp-cron.php file.
However, according to my robust searches, the recommended command strings are… legion:
wget http://www.XXX.com/wp-cron.php
wget –q http://www.XXX.com/wp-cron.php -O /dev/null
wget -q -O – http://www.XXX.com/wp-cron.php >/dev/null 2>&1
wget -q -O – http://www.XXX.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1
wget -O /dev/null http://www.XXX.com/wp-cron.php
php -q /home/cPanel_User/public_html/wp-cron.php
Sweet. (Or copacetic, perhaps, a word I vowed at one time never to utter, except, perhaps, sarcastically.)
It turns out that I need to do something different, anyway, but now that I can't unsee it, the ol' brain will have to chew the permutations for a while.
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| 1 | ||||||
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 9 | 10 | 11 | 12 | 13 | 14 | 15 |
| 16 | 17 | 18 | 19 | 20 | 21 | 22 |
| 23 | 24 | 25 | 26 | 27 | 28 | 29 |
| 30 | ||||||