export a csv file from the database with a cronjob
export a csv file from the database with a cronjob
export a csv file from the database with a cronjob
If it’s a one-time maintenance issue then run the code manually at a time you chose. If it’s a periodic maintenance task that might be heavy, use unix cron. Otherwise, wp-cron can be used. You’re probably using it more than you know already. This plugin is great for monitoring wp-cron.
It could be the phrasing of the array so try setting the array outside the wp_schedule_event call: $args = array(‘type’=>$instance[‘type’]); wp_schedule_event(time() , ‘twicedaily’, ‘fhprw_action’,$args);
Ok, so it turns out the solution is slightly embarrassing on my part and I couldn’t see the forest for the trees. The code that was executed by the cron job was trying to check the contents of a variable that is set via a radio button on the admin / plugin activation page. Thus, … Read more
Take a look at the Transients API. It’s meant to store data temporary. Note, that this doesn’t replace a cron job, as it needs “Action” on the site. So if the site isn’t requested, where you set/alter/delete a Transient, then nothing happens.
Take a look at the docs. That plugin uses Simplepie as an aggregator. Google results: http://simplepie.org/wiki/tutorial/setting_up_a_cron_job_with_simplepie
Use the action update_option_{$option}, where $option is the same as the second argument for register_setting(). This hook fires after the option has been updated. add_filter( ‘update_option_directory’, ‘run_after_change’, 10, 2 ); function run_after_change( $old_value, $new_value ) { // compare both values and do something } 10 is the priority, 2 the number of accepted arguments for … Read more
…if you have low traffic on your site it may never run due to the way how WP Cron works In your particular example it should always fire. Since save_post runs just before a browser redirect, the subsequent request back to the edit screen will fire the cron schedule. …won’t that delay the page rendering … Read more
It looks like Howdy_McGee pinpointed the issue in a comment on the original question: Make the new_interval() a method of your class and call the filter inside your activation hook (above the cron registrations): add_filter(‘cron_schedules’, array( $this, ‘new_interval’ ) );
You should set up a cron job on the server to do what the plugin authors are asking you to do: execute the php command they’ve given you. Just make sure you’re not setting up WordPress’s wp_cron(), since this one is not a real cron job. From this article: When it comes to WordPress, you … Read more