I have worked on creating a plugin for setting a cron job. However it runs only when a person visits it. Can we link it with linux so that it opens the site and the cron job is done without anyone visiting the page. How can we use wget for this if the wordpress is set up locally?
2 comments
Comments are closed.
Do this following steps to get your server cron going, enable server cron from plugin is not possible as of now (as i understand).
You can disable WP-cron by modifying the wp-config.php (located in the folder where WordPress is installed). Open the wp-config.php file, add a new line after
To set up a Linux cron job:
Log into your cPanel.
In the Advanced section, click Cron jobs.
Under Add New Cron Job, select the time interval. HostGator recommends that you do not set the interval lower than 15 minutes.
Set the cron command to the following, replacing yourwebsite.com with your actual domain name:
The above command tells the Linux server to run wp-cron via
wget
, which will trigger the wp-cron.php script to do it’s job on your schedule instead of on each page view.Click Add New Cron Job to set the cron.
In order to test out the new cron, simply wait for the elapsed time period for the cron to run. In the event that the cron does not run, please review the steps listed above to ensure that you have completed all steps correctly.
CREDITS:
http://support.hostgator.com/articles/specialized-help/technical/wordpress/how-to-replace-wordpress-cron-with-a-real-cron-job
You can schedule a cronjob.