execute function in wordpress plugin using crontab

Question

So, I want to run a function on my plugin from crontab. For the example, I want to run it every day at 1:10am

function my_cronjob_action () {
    //this function is in my plugin
    // code to execute on cron run
    syslog(LOG_DEBUG, 'executed by unix cron');
} add_action('my_cronjob_action', 'my_cronjob_action');

I’ve disabled wp-cron by adding define( 'DISABLE_WP_CRON', true ); into wp-config.php
what’s the next step so the function can be executed from crontab?

Thank you before.

0
Fatimah Wulandari 3 years 2020-05-30T14:10:24-05:00 0 Answers 83 views 0

Leave an answer

Browse
Browse