Osclass CRON

Osclass has built-in functionality for cron jobs that can be activated from the admin dashboard under General tab and Cron Settings. The cron is trigger by the visits on the site and will run every hour if you have visits on the site.

You can configure your system's  cron to work with osclass but remember to disable Auto-cron option from osclass settings. Most likely you will have an option in cPanel to set a cron job, but if you don't have you can ask your hosting provider to configure a cron job for you.

You can also trigger the cron by direct access on this link:

your-domain.com/index.php?page=cron

The system cron can be set to access the same link to run the cron.

Osclass has hook for each cron type and we can use this hooks to run our functions that will do some tasks.

Hourly cron

osc_run_hook('cron_hourly');

You can use this hook to run a function in every hour and perform some task, like so:

    function my_custom_cron_hourly(){
        //Some code here that will be trigger in every hour
        
    }
    osc_add_hook('cron_hourly','my_custom_cron_hourly');

Daily cron

osc_run_hook('cron_daily');

Example for daily cron:

   function my_custom_cron_daily(){
        //Some code here that will be trigger daily
        
    }
    osc_add_hook('cron_daily','my_custom_cron_daily');

Weekly cron

osc_run_hook('cron_weekly');

Example for weekly cron:

   function my_custom_cron_weekly(){
        //Some code here that will be trigger weekly
        
    }
    osc_add_hook('cron_weekly','my_custom_cron_weekly');

Automate your tasks with osclass cron, and you don't have to to do a task on a specific date. Don't forget to deactivate Auto-cron from osclass if you use your system cron, and that Auto- cron is triggered by visists on your site.

Subscribe
X

Subscribe!

Subscribe to get the latest listings, updates and special offers delivered directly in your inbox.