Digital Marketing has never been on the rise as much as during lockdown. All...
Do you care about how cron works in the operating system? Cron is time based task scheduling system. You can schedule a cron job at a particular time. It can be scheduled to check updates or any other task.
What is WordPress Cron?
WordPress cron is a mechanism defined to trigger a scheduled event on every page load. On every page load (Page load happens when anyone visits your website) wordpress cron, which is defined in wp-cron.php file checks the list of scheduled tasks which needs to run.
We will discuss today on the Linux cron job versus WordPress con job and which one is better and how to schedule wordpress cron to optimise the use of expensive resources like CPU and RAM.
Understanding the Linux/Wordpress Scheduler Job ( Do not Miss this Part )
There is a catch here, with the Linux scheduler, if the time passes and the task did not run, it will not be re-attempted if Linux scheduler is not scheduled to run with an interval. So make sure the Linux scheduler executes the cron command on an interval. Usually it makes sense to maintain a small regular interval .
Do the change
Set up the linux cron job for wordpress every five minute.
- Disable wordpress cron
Add following in wp-config.php in public_html folder
2. Add below command and schedule it to run at a regular interval.
Assuming xyz is your website.
You can set up command via cron job tool in your account using either of below mentioned commands.
Author: Rajnish K
About Author :
Rajnishk is a Serial Entrepreneur, R&D Expert and is passionate for Full Stack. He can be reached at firstname.lastname@example.org